// AUTO-GENERATED by scripts/generate.ts from .generated-specs. Do not edit. import * as S from "@distilled.cloud/core/schema"; import * as API from "@distilled.cloud/core/api"; import * as T from "../traits.ts"; import { CloudflareProtocol, CloudflarePaginatedProtocol, type CloudflareOpError, type CloudflareOpContext, } from "../protocol.ts"; import { cloudflarePaginate, ResultInfo } from "../pagination.ts"; import { CloudflareError, CloudflareRateLimited } from "../errors.ts"; import * as Retry from "../retry.ts"; export type { CloudflareOpError, CloudflareOpContext }; /** Fallback camelCase→wire mapping for opaque content (mined from the distilled SDK). */ const KEY_DICTIONARY: Record> = { catchBlock: "catch_block", className: "class_name", createdOn: "created_on", endedOn: "ended_on", errorRetention: "error_retention", eventType: "event_type", finallyBlock: "finally_block", hasDag: "has_dag", instanceId: "instance_id", instanceRetention: "instance_retention", isDeleted: "is_deleted", modifiedOn: "modified_on", nextInstance: "next_instance", perPage: "per_page", resultInfo: "result_info", scriptName: "script_name", startedOn: "started_on", stepCount: "step_count", successRetention: "success_retention", terminatorRunning: "terminator_running", totalCount: "total_count", triggerSource: "trigger_source", triggeredOn: "triggered_on", tryBlock: "try_block", versionId: "version_id", workflowId: "workflow_id", }; export class InstanceAlreadyExists extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()( "InstanceAlreadyExists", { code: S.Number, message: S.String, }, ), [{ code: 10405 }], ) {} export class InstanceCannotTerminate extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()( "InstanceCannotTerminate", { code: S.Number, message: S.String, }, ), [{ code: 10401 }], ) {} export class InstanceNotFound extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("InstanceNotFound", { code: S.Number, message: S.String, }), [{ code: 10201 }, { code: 10400 }], ) {} export class InvalidBody extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("InvalidBody", { code: S.Number, message: S.String, }), [{ code: 10002 }], ) {} export class InvalidRoute extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("InvalidRoute", { code: S.Number, message: S.String, }), [{ code: 7003 }], ) {} export class VersionNotFound extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("VersionNotFound", { code: S.Number, message: S.String, }), [{ code: 10300 }], ) {} export class WorkflowInternalError extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()( "WorkflowInternalError", { code: S.Number, message: S.String, }, ), [{ code: 10001 }], ) {} export class WorkflowNotFound extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("WorkflowNotFound", { code: S.Number, message: S.String, }), [{ code: 10200 }], ) {} export type InstancesBulkRequestBodyItemInstanceRetentionErrorRetention = | string | number; export const InstancesBulkRequestBodyItemInstanceRetentionErrorRetention = /*@__PURE__*/ S.Unknown.pipe(T.UnionCases([[], []])); export type InstancesBulkRequestBodyItemInstanceRetentionSuccessRetention = | string | number; export const InstancesBulkRequestBodyItemInstanceRetentionSuccessRetention = /*@__PURE__*/ S.Unknown.pipe(T.UnionCases([[], []])); export interface InstancesBulkRequestBodyItemInstanceRetention { /** Specifies the duration in milliseconds or as a string like '5 minutes'. */ errorRetention?: InstancesBulkRequestBodyItemInstanceRetentionErrorRetention; /** Specifies the duration in milliseconds or as a string like '5 minutes'. */ successRetention?: InstancesBulkRequestBodyItemInstanceRetentionSuccessRetention; } export const InstancesBulkRequestBodyItemInstanceRetention = /*@__PURE__*/ S.suspend(() => S.Struct({ errorRetention: S.optional( InstancesBulkRequestBodyItemInstanceRetentionErrorRetention.pipe( T.Body("error_retention"), ), ), successRetention: S.optional( InstancesBulkRequestBodyItemInstanceRetentionSuccessRetention.pipe( T.Body("success_retention"), ), ), }), ).annotate({ identifier: "InstancesBulkRequestBodyItemInstanceRetention", }) as any as S.Schema; export interface InstancesBulkRequestBodyItem { instanceId?: string; instanceRetention?: InstancesBulkRequestBodyItemInstanceRetention; params?: unknown; } export const InstancesBulkRequestBodyItem = /*@__PURE__*/ S.suspend(() => S.Struct({ instanceId: S.optional(S.String.pipe(T.Body("instance_id"))), instanceRetention: S.optional( InstancesBulkRequestBodyItemInstanceRetention.pipe( T.Body("instance_retention"), ), ), params: S.optional(S.Unknown), }), ).annotate({ identifier: "InstancesBulkRequestBodyItem", }) as any as S.Schema; export type InstancesBulkRequestBodyList = Array; export const InstancesBulkRequestBodyList = /*@__PURE__*/ S.Array( InstancesBulkRequestBodyItem, ) as any as S.Schema; export interface BulkInstanceRequest { accountId: string; workflowName: string; body?: InstancesBulkRequestBodyList; } export const BulkInstanceRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), workflowName: S.String.pipe(T.Label("workflow_name")), body: S.optional(InstancesBulkRequestBodyList.pipe(T.HttpBody())), }) .pipe( T.Http({ method: "POST", uri: "/accounts/{account_id}/workflows/{workflow_name}/instances/batch", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "BulkInstanceRequest", }) as any as S.Schema; export type InstancesBulkResultItemStatus = | "queued" | "running" | "paused" | "errored" | "terminated" | "complete" | "waitingForPause" | "waiting" | "rollingBack"; export const InstancesBulkResultItemStatus = /*@__PURE__*/ S.String; export type InstancesBulkResultItemTriggerSource = | "unknown" | "api" | "binding" | "event" | "cron"; export const InstancesBulkResultItemTriggerSource = /*@__PURE__*/ S.String; export interface InstancesBulkResultItem { id: string; status: InstancesBulkResultItemStatus; versionId: string; workflowId: string; triggerSource?: InstancesBulkResultItemTriggerSource | null; } export const InstancesBulkResultItem = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, status: InstancesBulkResultItemStatus, versionId: S.String.pipe(T.Body("version_id")), workflowId: S.String.pipe(T.Body("workflow_id")), triggerSource: S.optional( S.NullOr(InstancesBulkResultItemTriggerSource).pipe( T.Body("trigger_source"), ), ), }), ).annotate({ identifier: "InstancesBulkResultItem", }) as any as S.Schema; export type InstancesBulkResultList = Array; export const InstancesBulkResultList = /*@__PURE__*/ S.Array( InstancesBulkResultItem, ) as any as S.Schema; export interface BulkInstanceResponse { /** The unwrapped `result` payload of the v4 response envelope. */ result: InstancesBulkResultList; /** Pagination info from the envelope's `result_info`. */ resultInfo?: ResultInfo | null; } export const BulkInstanceResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ result: InstancesBulkResultList.pipe(T.EnvelopePayload()), resultInfo: S.optional(S.NullOr(ResultInfo).pipe(T.ResultInfo())), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "BulkInstanceResponse", }) as any as S.Schema; export type InstancesCreateRequestInstanceRetentionErrorRetention = | string | number; export const InstancesCreateRequestInstanceRetentionErrorRetention = /*@__PURE__*/ S.Unknown.pipe(T.UnionCases([[], []])); export type InstancesCreateRequestInstanceRetentionSuccessRetention = | string | number; export const InstancesCreateRequestInstanceRetentionSuccessRetention = /*@__PURE__*/ S.Unknown.pipe(T.UnionCases([[], []])); export interface InstancesCreateRequestInstanceRetention { /** Specifies the duration in milliseconds or as a string like '5 minutes'. */ errorRetention?: InstancesCreateRequestInstanceRetentionErrorRetention; /** Specifies the duration in milliseconds or as a string like '5 minutes'. */ successRetention?: InstancesCreateRequestInstanceRetentionSuccessRetention; } export const InstancesCreateRequestInstanceRetention = /*@__PURE__*/ S.suspend( () => S.Struct({ errorRetention: S.optional( InstancesCreateRequestInstanceRetentionErrorRetention.pipe( T.Body("error_retention"), ), ), successRetention: S.optional( InstancesCreateRequestInstanceRetentionSuccessRetention.pipe( T.Body("success_retention"), ), ), }), ).annotate({ identifier: "InstancesCreateRequestInstanceRetention", }) as any as S.Schema; export interface CreateInstanceRequest { accountId: string; workflowName: string; instanceId?: string; instanceRetention?: InstancesCreateRequestInstanceRetention; params?: unknown; } export const CreateInstanceRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), workflowName: S.String.pipe(T.Label("workflow_name")), instanceId: S.optional(S.String.pipe(T.Body("instance_id"))), instanceRetention: S.optional( InstancesCreateRequestInstanceRetention.pipe( T.Body("instance_retention"), ), ), params: S.optional(S.Unknown), }) .pipe( T.Http({ method: "POST", uri: "/accounts/{account_id}/workflows/{workflow_name}/instances", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateInstanceRequest", }) as any as S.Schema; export type InstancesCreateResponseStatus = | "queued" | "running" | "paused" | "errored" | "terminated" | "complete" | "waitingForPause" | "waiting" | "rollingBack"; export const InstancesCreateResponseStatus = /*@__PURE__*/ S.String; export type InstancesCreateResponseTriggerSource = | "unknown" | "api" | "binding" | "event" | "cron"; export const InstancesCreateResponseTriggerSource = /*@__PURE__*/ S.String; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface CreateInstanceResponse { id: string; status: InstancesCreateResponseStatus; versionId: string; workflowId: string; triggerSource?: InstancesCreateResponseTriggerSource | null; } export const CreateInstanceResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, status: InstancesCreateResponseStatus, versionId: S.String.pipe(T.Body("version_id")), workflowId: S.String.pipe(T.Body("workflow_id")), triggerSource: S.optional( S.NullOr(InstancesCreateResponseTriggerSource).pipe( T.Body("trigger_source"), ), ), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateInstanceResponse", }) as any as S.Schema; export interface CreateInstanceEventRequest { accountId: string; workflowName: string; /** Instance identifier. User-created instances match `^[a-zA-Z0-9_][a-zA-Z0-9-_]*$` (max 100 characters); cron-triggered instances can use a longer, system-generated id derived from the cron expression. */ instanceId: string; eventType: string; } export const CreateInstanceEventRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), workflowName: S.String.pipe(T.Label("workflow_name")), instanceId: S.String.pipe(T.Label("instance_id")), eventType: S.String.pipe(T.Label("event_type")), }) .pipe( T.Http({ method: "POST", uri: "/accounts/{account_id}/workflows/{workflow_name}/instances/{instance_id}/events/{event_type}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateInstanceEventRequest", }) as any as S.Schema; export type CreateInstanceEventResponse = unknown; export const CreateInstanceEventResponse = /*@__PURE__*/ S.suspend(() => S.Unknown.pipe(T.EnvelopePayloadRoot(), T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateInstanceEventResponse", }) as any as S.Schema; export interface DeleteWorkflowRequest { accountId: string; workflowName: string; } export const DeleteWorkflowRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), workflowName: S.String.pipe(T.Label("workflow_name")), }) .pipe( T.Http({ method: "DELETE", uri: "/accounts/{account_id}/workflows/{workflow_name}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteWorkflowRequest", }) as any as S.Schema; export type DeleteResponseStatus = "ok"; export const DeleteResponseStatus = /*@__PURE__*/ S.String; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface DeleteWorkflowResponse { status: DeleteResponseStatus; success: boolean; } export const DeleteWorkflowResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ status: DeleteResponseStatus, success: S.Boolean, }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteWorkflowResponse", }) as any as S.Schema; export type InstancesGetRequestOrder = "asc" | "desc"; export const InstancesGetRequestOrder = /*@__PURE__*/ S.String; export type InstancesGetRequestSimple = "true" | "false"; export const InstancesGetRequestSimple = /*@__PURE__*/ S.String; export interface GetInstanceRequest { accountId: string; workflowName: string; /** Instance identifier. User-created instances match `^[a-zA-Z0-9_][a-zA-Z0-9-_]*$` (max 100 characters); cron-triggered instances can use a longer, system-generated id derived from the cron expression. */ instanceId: string; /** Step ordering: "asc" (default, oldest first) or "desc" (newest first). */ order?: InstancesGetRequestOrder | (string & {}); /** When true, omits step details and returns only metadata with step_count. */ simple?: InstancesGetRequestSimple | (string & {}); } export const GetInstanceRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), workflowName: S.String.pipe(T.Label("workflow_name")), instanceId: S.String.pipe(T.Label("instance_id")), order: S.optional(InstancesGetRequestOrder.pipe(T.Query())), simple: S.optional(InstancesGetRequestSimple.pipe(T.Query())), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/workflows/{workflow_name}/instances/{instance_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetInstanceRequest", }) as any as S.Schema; export interface InstancesGetResponseError { message: string; name: string; } export const InstancesGetResponseError = /*@__PURE__*/ S.suspend(() => S.Struct({ message: S.String, name: S.String, }), ).annotate({ identifier: "InstancesGetResponseError", }) as any as S.Schema; export type InstancesGetResponseOutput = string | number; export const InstancesGetResponseOutput = /*@__PURE__*/ S.Unknown.pipe( T.UnionCases([[], []]), ); export type InstancesGetResponseRollbackError = InstancesGetResponseError; export const InstancesGetResponseRollbackError = InstancesGetResponseError; export type InstancesGetResponseRollbackOutcome = "complete" | "failed"; export const InstancesGetResponseRollbackOutcome = /*@__PURE__*/ S.String; export interface InstancesGetResponseRollback { error: InstancesGetResponseError; outcome: InstancesGetResponseRollbackOutcome; } export const InstancesGetResponseRollback = /*@__PURE__*/ S.suspend(() => S.Struct({ error: InstancesGetResponseError, outcome: InstancesGetResponseRollbackOutcome, }), ).annotate({ identifier: "InstancesGetResponseRollback", }) as any as S.Schema; export type InstancesGetResponseStatus = | "queued" | "running" | "paused" | "errored" | "terminated" | "complete" | "waitingForPause" | "waiting" | "rollingBack"; export const InstancesGetResponseStatus = /*@__PURE__*/ S.String; export type InstancesGetResponseStepsItemCase0AttemptsItemError = InstancesGetResponseError; export const InstancesGetResponseStepsItemCase0AttemptsItemError = InstancesGetResponseError; export interface InstancesGetResponseStepsItemCase0AttemptsItem { end: string; error: InstancesGetResponseError; start: string; success: boolean; } export const InstancesGetResponseStepsItemCase0AttemptsItem = /*@__PURE__*/ S.suspend(() => S.Struct({ end: S.String, error: InstancesGetResponseError, start: S.String, success: S.Boolean, }), ).annotate({ identifier: "InstancesGetResponseStepsItemCase0AttemptsItem", }) as any as S.Schema; export type InstancesGetResponseStepsItemCase0AttemptsList = Array; export const InstancesGetResponseStepsItemCase0AttemptsList = /*@__PURE__*/ S.Array( InstancesGetResponseStepsItemCase0AttemptsItem, ) as any as S.Schema; export type InstancesGetResponseStepsItemCase0ConfigRetriesDelay = | string | number; export const InstancesGetResponseStepsItemCase0ConfigRetriesDelay = /*@__PURE__*/ S.Unknown.pipe(T.UnionCases([[], []])); export type InstancesGetResponseStepsItemCase0ConfigRetriesBackoff = | "constant" | "linear" | "exponential"; export const InstancesGetResponseStepsItemCase0ConfigRetriesBackoff = /*@__PURE__*/ S.String; export interface InstancesGetResponseStepsItemCase0ConfigRetries { /** Specifies the delay duration. '[dynamic]' indicates the delay is computed by a user-supplied function. */ delay: InstancesGetResponseStepsItemCase0ConfigRetriesDelay; limit: number; backoff?: InstancesGetResponseStepsItemCase0ConfigRetriesBackoff | null; } export const InstancesGetResponseStepsItemCase0ConfigRetries = /*@__PURE__*/ S.suspend(() => S.Struct({ delay: InstancesGetResponseStepsItemCase0ConfigRetriesDelay, limit: S.Number, backoff: S.optional( S.NullOr(InstancesGetResponseStepsItemCase0ConfigRetriesBackoff), ), }), ).annotate({ identifier: "InstancesGetResponseStepsItemCase0ConfigRetries", }) as any as S.Schema; export type InstancesGetResponseStepsItemCase0ConfigTimeout = string | number; export const InstancesGetResponseStepsItemCase0ConfigTimeout = /*@__PURE__*/ S.Unknown.pipe(T.UnionCases([[], []])); export type InstancesGetResponseStepsItemCase0ConfigSensitive = "output"; export const InstancesGetResponseStepsItemCase0ConfigSensitive = /*@__PURE__*/ S.String; export interface InstancesGetResponseStepsItemCase0Config { retries: InstancesGetResponseStepsItemCase0ConfigRetries; /** Specifies the timeout duration. */ timeout: InstancesGetResponseStepsItemCase0ConfigTimeout; /** When set to 'output', step output is redacted from log and step output responses. */ sensitive?: InstancesGetResponseStepsItemCase0ConfigSensitive | null; } export const InstancesGetResponseStepsItemCase0Config = /*@__PURE__*/ S.suspend( () => S.Struct({ retries: InstancesGetResponseStepsItemCase0ConfigRetries, timeout: InstancesGetResponseStepsItemCase0ConfigTimeout, sensitive: S.optional( S.NullOr(InstancesGetResponseStepsItemCase0ConfigSensitive), ), }), ).annotate({ identifier: "InstancesGetResponseStepsItemCase0Config", }) as any as S.Schema; export type InstancesGetResponseStepsItemCase0Type = "step" | "rollback"; export const InstancesGetResponseStepsItemCase0Type = /*@__PURE__*/ S.String; export interface InstancesGetResponseStepsItemCase0 { attempts: InstancesGetResponseStepsItemCase0AttemptsList; config: InstancesGetResponseStepsItemCase0Config; end: string; name: string; output: string; start: string; success: boolean; type: InstancesGetResponseStepsItemCase0Type; } export const InstancesGetResponseStepsItemCase0 = /*@__PURE__*/ S.suspend(() => S.Struct({ attempts: InstancesGetResponseStepsItemCase0AttemptsList, config: InstancesGetResponseStepsItemCase0Config, end: S.String, name: S.String, output: S.String, start: S.String, success: S.Boolean, type: InstancesGetResponseStepsItemCase0Type, }), ).annotate({ identifier: "InstancesGetResponseStepsItemCase0", }) as any as S.Schema; export type InstancesGetResponseStepsItemCase1Error = InstancesGetResponseError; export const InstancesGetResponseStepsItemCase1Error = InstancesGetResponseError; export type InstancesGetResponseStepsItemCase1Type = "sleep"; export const InstancesGetResponseStepsItemCase1Type = /*@__PURE__*/ S.String; export interface InstancesGetResponseStepsItemCase1 { end: string; error: InstancesGetResponseError; finished: boolean; name: string; start: string; type: InstancesGetResponseStepsItemCase1Type; } export const InstancesGetResponseStepsItemCase1 = /*@__PURE__*/ S.suspend(() => S.Struct({ end: S.String, error: InstancesGetResponseError, finished: S.Boolean, name: S.String, start: S.String, type: InstancesGetResponseStepsItemCase1Type, }), ).annotate({ identifier: "InstancesGetResponseStepsItemCase1", }) as any as S.Schema; export interface InstancesGetResponseStepsItemCase2Trigger { source: string; } export const InstancesGetResponseStepsItemCase2Trigger = /*@__PURE__*/ S.suspend(() => S.Struct({ source: S.String, }), ).annotate({ identifier: "InstancesGetResponseStepsItemCase2Trigger", }) as any as S.Schema; export type InstancesGetResponseStepsItemCase2Type = "termination"; export const InstancesGetResponseStepsItemCase2Type = /*@__PURE__*/ S.String; export interface InstancesGetResponseStepsItemCase2 { trigger: InstancesGetResponseStepsItemCase2Trigger; type: InstancesGetResponseStepsItemCase2Type; } export const InstancesGetResponseStepsItemCase2 = /*@__PURE__*/ S.suspend(() => S.Struct({ trigger: InstancesGetResponseStepsItemCase2Trigger, type: InstancesGetResponseStepsItemCase2Type, }), ).annotate({ identifier: "InstancesGetResponseStepsItemCase2", }) as any as S.Schema; export type InstancesGetResponseStepsItemCase3Error = InstancesGetResponseError; export const InstancesGetResponseStepsItemCase3Error = InstancesGetResponseError; export type InstancesGetResponseStepsItemCase3Type = "waitForEvent"; export const InstancesGetResponseStepsItemCase3Type = /*@__PURE__*/ S.String; export interface InstancesGetResponseStepsItemCase3 { end: string; error: InstancesGetResponseError; finished: boolean; name: string; start: string; type: InstancesGetResponseStepsItemCase3Type; output?: string | null; } export const InstancesGetResponseStepsItemCase3 = /*@__PURE__*/ S.suspend(() => S.Struct({ end: S.String, error: InstancesGetResponseError, finished: S.Boolean, name: S.String, start: S.String, type: InstancesGetResponseStepsItemCase3Type, output: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "InstancesGetResponseStepsItemCase3", }) as any as S.Schema; export type InstancesGetResponseStepsItem = | InstancesGetResponseStepsItemCase0 | InstancesGetResponseStepsItemCase1 | InstancesGetResponseStepsItemCase2 | InstancesGetResponseStepsItemCase3; export const InstancesGetResponseStepsItem = /*@__PURE__*/ S.Unknown.pipe( T.UnionCases([ ["attempts", "config", "end", "name", "output", "start", "success", "type"], ["end", "error", "finished", "name", "start", "type"], ["trigger", "type"], ["end", "error", "finished", "name", "start", "type", "output"], ]), ); export type InstancesGetResponseStepsList = Array; export const InstancesGetResponseStepsList = /*@__PURE__*/ S.Array( InstancesGetResponseStepsItem, ) as any as S.Schema; export type InstancesGetResponseTriggerSource = | "unknown" | "api" | "binding" | "event" | "cron"; export const InstancesGetResponseTriggerSource = /*@__PURE__*/ S.String; export interface InstancesGetResponseTrigger { source: InstancesGetResponseTriggerSource; } export const InstancesGetResponseTrigger = /*@__PURE__*/ S.suspend(() => S.Struct({ source: InstancesGetResponseTriggerSource, }), ).annotate({ identifier: "InstancesGetResponseTrigger", }) as any as S.Schema; export interface InstancesGetResponseSchedule { cron: string; scheduledTime: number; } export const InstancesGetResponseSchedule = /*@__PURE__*/ S.suspend(() => S.Struct({ cron: S.String, scheduledTime: S.Number, }), ).annotate({ identifier: "InstancesGetResponseSchedule", }) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface GetInstanceResponse { end: string; error: InstancesGetResponseError; output: InstancesGetResponseOutput; params: unknown; queued: string; rollback: InstancesGetResponseRollback; start: string; status: InstancesGetResponseStatus; stepCount: number; steps: InstancesGetResponseStepsList; success: boolean; trigger: InstancesGetResponseTrigger; versionId: string; schedule?: InstancesGetResponseSchedule | null; } export const GetInstanceResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ end: S.String, error: InstancesGetResponseError, output: InstancesGetResponseOutput, params: S.Unknown, queued: S.String, rollback: InstancesGetResponseRollback, start: S.String, status: InstancesGetResponseStatus, stepCount: S.Number.pipe(T.Body("step_count")), steps: InstancesGetResponseStepsList, success: S.Boolean, trigger: InstancesGetResponseTrigger, versionId: S.String, schedule: S.optional(S.NullOr(InstancesGetResponseSchedule)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetInstanceResponse", }) as any as S.Schema; export interface GetVersionRequest { accountId: string; workflowName: string; versionId: string; } export const GetVersionRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), workflowName: S.String.pipe(T.Label("workflow_name")), versionId: S.String.pipe(T.Label("version_id")), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/workflows/{workflow_name}/versions/{version_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetVersionRequest", }) as any as S.Schema; export type VersionsGetResponseLanguage = "javascript" | "python"; export const VersionsGetResponseLanguage = /*@__PURE__*/ S.String; export interface VersionsGetResponseLimits { steps?: number | null; } export const VersionsGetResponseLimits = /*@__PURE__*/ S.suspend(() => S.Struct({ steps: S.optional(S.NullOr(S.Number)), }), ).annotate({ identifier: "VersionsGetResponseLimits", }) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface GetVersionResponse { id: string; className: string; createdOn: string; hasDag: boolean; /** The programming language of the workflow implementation */ language: VersionsGetResponseLanguage; modifiedOn: string; workflowId: string; limits?: VersionsGetResponseLimits | null; } export const GetVersionResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, className: S.String.pipe(T.Body("class_name")), createdOn: S.String.pipe(T.Body("created_on")), hasDag: S.Boolean.pipe(T.Body("has_dag")), language: VersionsGetResponseLanguage, modifiedOn: S.String.pipe(T.Body("modified_on")), workflowId: S.String.pipe(T.Body("workflow_id")), limits: S.optional(S.NullOr(VersionsGetResponseLimits)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetVersionResponse", }) as any as S.Schema; export interface GetWorkflowRequest { accountId: string; workflowName: string; } export const GetWorkflowRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), workflowName: S.String.pipe(T.Label("workflow_name")), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/workflows/{workflow_name}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetWorkflowRequest", }) as any as S.Schema; export interface GetResponseInstances { complete?: number | null; errored?: number | null; paused?: number | null; queued?: number | null; rollingBack?: number | null; running?: number | null; terminated?: number | null; waiting?: number | null; waitingForPause?: number | null; } export const GetResponseInstances = /*@__PURE__*/ S.suspend(() => S.Struct({ complete: S.optional(S.NullOr(S.Number)), errored: S.optional(S.NullOr(S.Number)), paused: S.optional(S.NullOr(S.Number)), queued: S.optional(S.NullOr(S.Number)), rollingBack: S.optional(S.NullOr(S.Number)), running: S.optional(S.NullOr(S.Number)), terminated: S.optional(S.NullOr(S.Number)), waiting: S.optional(S.NullOr(S.Number)), waitingForPause: S.optional(S.NullOr(S.Number)), }), ).annotate({ identifier: "GetResponseInstances", }) as any as S.Schema; export interface GetResponseSchedulesItem { cron: string; nextInstance: string; } export const GetResponseSchedulesItem = /*@__PURE__*/ S.suspend(() => S.Struct({ cron: S.String, nextInstance: S.String.pipe(T.Body("next_instance")), }), ).annotate({ identifier: "GetResponseSchedulesItem", }) as any as S.Schema; export type GetResponseSchedulesList = Array; export const GetResponseSchedulesList = /*@__PURE__*/ S.Array( GetResponseSchedulesItem, ) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface GetWorkflowResponse { id: string; className: string; createdOn: string; instances: GetResponseInstances; modifiedOn: string; name: string; scriptName: string; triggeredOn: string; schedules?: GetResponseSchedulesList | null; } export const GetWorkflowResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, className: S.String.pipe(T.Body("class_name")), createdOn: S.String.pipe(T.Body("created_on")), instances: GetResponseInstances, modifiedOn: S.String.pipe(T.Body("modified_on")), name: S.String, scriptName: S.String.pipe(T.Body("script_name")), triggeredOn: S.String.pipe(T.Body("triggered_on")), schedules: S.optional(S.NullOr(GetResponseSchedulesList)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetWorkflowResponse", }) as any as S.Schema; export interface GraphVersionRequest { accountId: string; workflowName: string; versionId: string; } export const GraphVersionRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), workflowName: S.String.pipe(T.Label("workflow_name")), versionId: S.String.pipe(T.Label("version_id")), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/workflows/{workflow_name}/versions/{version_id}/graph", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GraphVersionRequest", }) as any as S.Schema; export type VersionsGraphResponseGraphWorkflowFunctionsValueNodesList = Array; export const VersionsGraphResponseGraphWorkflowFunctionsValueNodesList = /*@__PURE__*/ S.Array( S.Unknown, ) as any as S.Schema; export type VersionsGraphResponseGraphWorkflowFunctionsValueType = "function_def"; export const VersionsGraphResponseGraphWorkflowFunctionsValueType = /*@__PURE__*/ S.String; export interface VersionsGraphResponseGraphWorkflowFunctionsValue { name: string; /** Child nodes (recursive). */ nodes: VersionsGraphResponseGraphWorkflowFunctionsValueNodesList; type: VersionsGraphResponseGraphWorkflowFunctionsValueType; } export const VersionsGraphResponseGraphWorkflowFunctionsValue = /*@__PURE__*/ S.suspend(() => S.Struct({ name: S.String, nodes: VersionsGraphResponseGraphWorkflowFunctionsValueNodesList, type: VersionsGraphResponseGraphWorkflowFunctionsValueType, }), ).annotate({ identifier: "VersionsGraphResponseGraphWorkflowFunctionsValue", }) as any as S.Schema; export type VersionsGraphResponseGraphWorkflowFunctionsMap = { [key: string]: VersionsGraphResponseGraphWorkflowFunctionsValue | undefined; }; export const VersionsGraphResponseGraphWorkflowFunctionsMap = /*@__PURE__*/ S.Record( S.String, VersionsGraphResponseGraphWorkflowFunctionsValue, ) as any as S.Schema; export type VersionsGraphResponseGraphWorkflowNodesItemCase0Duration = | string | number; export const VersionsGraphResponseGraphWorkflowNodesItemCase0Duration = /*@__PURE__*/ S.Unknown.pipe(T.UnionCases([[], []])); export type VersionsGraphResponseGraphWorkflowNodesItemCase0Type = "step_sleep"; export const VersionsGraphResponseGraphWorkflowNodesItemCase0Type = /*@__PURE__*/ S.String; export interface VersionsGraphResponseGraphWorkflowNodesItemCase0 { /** Duration as milliseconds (number) or human-readable string. */ duration: VersionsGraphResponseGraphWorkflowNodesItemCase0Duration; name: string; type: VersionsGraphResponseGraphWorkflowNodesItemCase0Type; resolves?: number | null; starts?: number | null; } export const VersionsGraphResponseGraphWorkflowNodesItemCase0 = /*@__PURE__*/ S.suspend(() => S.Struct({ duration: VersionsGraphResponseGraphWorkflowNodesItemCase0Duration, name: S.String, type: VersionsGraphResponseGraphWorkflowNodesItemCase0Type, resolves: S.optional(S.NullOr(S.Number)), starts: S.optional(S.NullOr(S.Number)), }), ).annotate({ identifier: "VersionsGraphResponseGraphWorkflowNodesItemCase0", }) as any as S.Schema; export type VersionsGraphResponseGraphWorkflowNodesItemCase1ConfigRetriesBackoff = | "constant" | "linear" | "exponential"; export const VersionsGraphResponseGraphWorkflowNodesItemCase1ConfigRetriesBackoff = /*@__PURE__*/ S.String; export type VersionsGraphResponseGraphWorkflowNodesItemCase1ConfigRetriesDelay = | string | number; export const VersionsGraphResponseGraphWorkflowNodesItemCase1ConfigRetriesDelay = /*@__PURE__*/ S.Unknown.pipe(T.UnionCases([[], []])); export interface VersionsGraphResponseGraphWorkflowNodesItemCase1ConfigRetries { /** Backoff strategy for step retries. */ backoff: VersionsGraphResponseGraphWorkflowNodesItemCase1ConfigRetriesBackoff; /** Duration as milliseconds (number) or human-readable string. */ delay: VersionsGraphResponseGraphWorkflowNodesItemCase1ConfigRetriesDelay; limit: number; } export const VersionsGraphResponseGraphWorkflowNodesItemCase1ConfigRetries = /*@__PURE__*/ S.suspend(() => S.Struct({ backoff: VersionsGraphResponseGraphWorkflowNodesItemCase1ConfigRetriesBackoff, delay: VersionsGraphResponseGraphWorkflowNodesItemCase1ConfigRetriesDelay, limit: S.Number, }), ).annotate({ identifier: "VersionsGraphResponseGraphWorkflowNodesItemCase1ConfigRetries", }) as any as S.Schema; export type VersionsGraphResponseGraphWorkflowNodesItemCase1ConfigTimeout = | string | number; export const VersionsGraphResponseGraphWorkflowNodesItemCase1ConfigTimeout = /*@__PURE__*/ S.Unknown.pipe(T.UnionCases([[], []])); export interface VersionsGraphResponseGraphWorkflowNodesItemCase1Config { /** Retry policy for a step. */ retries: VersionsGraphResponseGraphWorkflowNodesItemCase1ConfigRetries; /** Duration as milliseconds (number) or human-readable string. */ timeout: VersionsGraphResponseGraphWorkflowNodesItemCase1ConfigTimeout; } export const VersionsGraphResponseGraphWorkflowNodesItemCase1Config = /*@__PURE__*/ S.suspend(() => S.Struct({ retries: VersionsGraphResponseGraphWorkflowNodesItemCase1ConfigRetries, timeout: VersionsGraphResponseGraphWorkflowNodesItemCase1ConfigTimeout, }), ).annotate({ identifier: "VersionsGraphResponseGraphWorkflowNodesItemCase1Config", }) as any as S.Schema; export type VersionsGraphResponseGraphWorkflowNodesItemCase1NodesList = Array; export const VersionsGraphResponseGraphWorkflowNodesItemCase1NodesList = /*@__PURE__*/ S.Array( S.Unknown, ) as any as S.Schema; export type VersionsGraphResponseGraphWorkflowNodesItemCase1Type = "step_do"; export const VersionsGraphResponseGraphWorkflowNodesItemCase1Type = /*@__PURE__*/ S.String; export interface VersionsGraphResponseGraphWorkflowNodesItemCase1 { /** Configuration for a step (retries and timeout). */ config: VersionsGraphResponseGraphWorkflowNodesItemCase1Config; name: string; /** Child nodes (recursive). */ nodes: VersionsGraphResponseGraphWorkflowNodesItemCase1NodesList; type: VersionsGraphResponseGraphWorkflowNodesItemCase1Type; resolves?: number | null; starts?: number | null; } export const VersionsGraphResponseGraphWorkflowNodesItemCase1 = /*@__PURE__*/ S.suspend(() => S.Struct({ config: VersionsGraphResponseGraphWorkflowNodesItemCase1Config, name: S.String, nodes: VersionsGraphResponseGraphWorkflowNodesItemCase1NodesList, type: VersionsGraphResponseGraphWorkflowNodesItemCase1Type, resolves: S.optional(S.NullOr(S.Number)), starts: S.optional(S.NullOr(S.Number)), }), ).annotate({ identifier: "VersionsGraphResponseGraphWorkflowNodesItemCase1", }) as any as S.Schema; export type VersionsGraphResponseGraphWorkflowNodesItemCase2OptionsTimeout = | string | number; export const VersionsGraphResponseGraphWorkflowNodesItemCase2OptionsTimeout = /*@__PURE__*/ S.Unknown.pipe(T.UnionCases([[], []])); export interface VersionsGraphResponseGraphWorkflowNodesItemCase2Options { eventType: string; /** Duration as milliseconds (number) or human-readable string. */ timeout: VersionsGraphResponseGraphWorkflowNodesItemCase2OptionsTimeout; } export const VersionsGraphResponseGraphWorkflowNodesItemCase2Options = /*@__PURE__*/ S.suspend(() => S.Struct({ eventType: S.String.pipe(T.Body("event_type")), timeout: VersionsGraphResponseGraphWorkflowNodesItemCase2OptionsTimeout, }), ).annotate({ identifier: "VersionsGraphResponseGraphWorkflowNodesItemCase2Options", }) as any as S.Schema; export type VersionsGraphResponseGraphWorkflowNodesItemCase2Type = "step_wait_for_event"; export const VersionsGraphResponseGraphWorkflowNodesItemCase2Type = /*@__PURE__*/ S.String; export type VersionsGraphResponseGraphWorkflowNodesItemCase2PayloadTypeType = "unknown"; export const VersionsGraphResponseGraphWorkflowNodesItemCase2PayloadTypeType = /*@__PURE__*/ S.String; export interface VersionsGraphResponseGraphWorkflowNodesItemCase2PayloadType { type: VersionsGraphResponseGraphWorkflowNodesItemCase2PayloadTypeType; } export const VersionsGraphResponseGraphWorkflowNodesItemCase2PayloadType = /*@__PURE__*/ S.suspend(() => S.Struct({ type: VersionsGraphResponseGraphWorkflowNodesItemCase2PayloadTypeType, }), ).annotate({ identifier: "VersionsGraphResponseGraphWorkflowNodesItemCase2PayloadType", }) as any as S.Schema; export type VersionsGraphResponseGraphWorkflowNodesItemCase2PayloadCase1FieldsMap = { [key: string]: unknown | undefined }; export const VersionsGraphResponseGraphWorkflowNodesItemCase2PayloadCase1FieldsMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type VersionsGraphResponseGraphWorkflowNodesItemCase2PayloadCase1Type = "object"; export const VersionsGraphResponseGraphWorkflowNodesItemCase2PayloadCase1Type = /*@__PURE__*/ S.String; export interface VersionsGraphResponseGraphWorkflowNodesItemCase2PayloadCase1 { /** Nested JsonShape fields (recursive structure). */ fields: VersionsGraphResponseGraphWorkflowNodesItemCase2PayloadCase1FieldsMap; type: VersionsGraphResponseGraphWorkflowNodesItemCase2PayloadCase1Type; } export const VersionsGraphResponseGraphWorkflowNodesItemCase2PayloadCase1 = /*@__PURE__*/ S.suspend(() => S.Struct({ fields: VersionsGraphResponseGraphWorkflowNodesItemCase2PayloadCase1FieldsMap, type: VersionsGraphResponseGraphWorkflowNodesItemCase2PayloadCase1Type, }), ).annotate({ identifier: "VersionsGraphResponseGraphWorkflowNodesItemCase2PayloadCase1", }) as any as S.Schema; export type VersionsGraphResponseGraphWorkflowNodesItemCase2Payload = | VersionsGraphResponseGraphWorkflowNodesItemCase2PayloadType | VersionsGraphResponseGraphWorkflowNodesItemCase2PayloadCase1; export const VersionsGraphResponseGraphWorkflowNodesItemCase2Payload = /*@__PURE__*/ S.Unknown.pipe(T.UnionCases([["type"], ["fields", "type"]])); export interface VersionsGraphResponseGraphWorkflowNodesItemCase2 { name: string; /** Options for a waitForEvent step. */ options: VersionsGraphResponseGraphWorkflowNodesItemCase2Options; type: VersionsGraphResponseGraphWorkflowNodesItemCase2Type; /** Shape descriptor for JSON payloads. */ payload?: VersionsGraphResponseGraphWorkflowNodesItemCase2Payload | null; resolves?: number | null; starts?: number | null; } export const VersionsGraphResponseGraphWorkflowNodesItemCase2 = /*@__PURE__*/ S.suspend(() => S.Struct({ name: S.String, options: VersionsGraphResponseGraphWorkflowNodesItemCase2Options, type: VersionsGraphResponseGraphWorkflowNodesItemCase2Type, payload: S.optional( S.NullOr(VersionsGraphResponseGraphWorkflowNodesItemCase2Payload), ), resolves: S.optional(S.NullOr(S.Number)), starts: S.optional(S.NullOr(S.Number)), }), ).annotate({ identifier: "VersionsGraphResponseGraphWorkflowNodesItemCase2", }) as any as S.Schema; export type VersionsGraphResponseGraphWorkflowNodesItemCase3Type = "step_sleep_until"; export const VersionsGraphResponseGraphWorkflowNodesItemCase3Type = /*@__PURE__*/ S.String; export interface VersionsGraphResponseGraphWorkflowNodesItemCase3 { name: string; timestamp: string; type: VersionsGraphResponseGraphWorkflowNodesItemCase3Type; resolves?: number | null; starts?: number | null; } export const VersionsGraphResponseGraphWorkflowNodesItemCase3 = /*@__PURE__*/ S.suspend(() => S.Struct({ name: S.String, timestamp: S.String, type: VersionsGraphResponseGraphWorkflowNodesItemCase3Type, resolves: S.optional(S.NullOr(S.Number)), starts: S.optional(S.NullOr(S.Number)), }), ).annotate({ identifier: "VersionsGraphResponseGraphWorkflowNodesItemCase3", }) as any as S.Schema; export type VersionsGraphResponseGraphWorkflowNodesItemCase4NodesList = Array; export const VersionsGraphResponseGraphWorkflowNodesItemCase4NodesList = /*@__PURE__*/ S.Array( S.Unknown, ) as any as S.Schema; export type VersionsGraphResponseGraphWorkflowNodesItemCase4Type = "loop"; export const VersionsGraphResponseGraphWorkflowNodesItemCase4Type = /*@__PURE__*/ S.String; export interface VersionsGraphResponseGraphWorkflowNodesItemCase4 { /** Child nodes (recursive). */ nodes: VersionsGraphResponseGraphWorkflowNodesItemCase4NodesList; type: VersionsGraphResponseGraphWorkflowNodesItemCase4Type; } export const VersionsGraphResponseGraphWorkflowNodesItemCase4 = /*@__PURE__*/ S.suspend(() => S.Struct({ nodes: VersionsGraphResponseGraphWorkflowNodesItemCase4NodesList, type: VersionsGraphResponseGraphWorkflowNodesItemCase4Type, }), ).annotate({ identifier: "VersionsGraphResponseGraphWorkflowNodesItemCase4", }) as any as S.Schema; export type VersionsGraphResponseGraphWorkflowNodesItemCase5Kind = | "all" | "any" | "all_settled" | "race"; export const VersionsGraphResponseGraphWorkflowNodesItemCase5Kind = /*@__PURE__*/ S.String; export type VersionsGraphResponseGraphWorkflowNodesItemCase5NodesList = Array; export const VersionsGraphResponseGraphWorkflowNodesItemCase5NodesList = /*@__PURE__*/ S.Array( S.Unknown, ) as any as S.Schema; export type VersionsGraphResponseGraphWorkflowNodesItemCase5Type = "parallel"; export const VersionsGraphResponseGraphWorkflowNodesItemCase5Type = /*@__PURE__*/ S.String; export interface VersionsGraphResponseGraphWorkflowNodesItemCase5 { /** Parallel execution strategy. */ kind: VersionsGraphResponseGraphWorkflowNodesItemCase5Kind; /** Child nodes (recursive). */ nodes: VersionsGraphResponseGraphWorkflowNodesItemCase5NodesList; type: VersionsGraphResponseGraphWorkflowNodesItemCase5Type; } export const VersionsGraphResponseGraphWorkflowNodesItemCase5 = /*@__PURE__*/ S.suspend(() => S.Struct({ kind: VersionsGraphResponseGraphWorkflowNodesItemCase5Kind, nodes: VersionsGraphResponseGraphWorkflowNodesItemCase5NodesList, type: VersionsGraphResponseGraphWorkflowNodesItemCase5Type, }), ).annotate({ identifier: "VersionsGraphResponseGraphWorkflowNodesItemCase5", }) as any as S.Schema; export type VersionsGraphResponseGraphWorkflowNodesItemCase6CatchBlockNodesList = Array; export const VersionsGraphResponseGraphWorkflowNodesItemCase6CatchBlockNodesList = /*@__PURE__*/ S.Array( S.Unknown, ) as any as S.Schema; export type VersionsGraphResponseGraphWorkflowNodesItemCase6CatchBlockType = "block"; export const VersionsGraphResponseGraphWorkflowNodesItemCase6CatchBlockType = /*@__PURE__*/ S.String; export interface VersionsGraphResponseGraphWorkflowNodesItemCase6CatchBlock { /** Child nodes (recursive). */ nodes: VersionsGraphResponseGraphWorkflowNodesItemCase6CatchBlockNodesList; type: VersionsGraphResponseGraphWorkflowNodesItemCase6CatchBlockType; } export const VersionsGraphResponseGraphWorkflowNodesItemCase6CatchBlock = /*@__PURE__*/ S.suspend(() => S.Struct({ nodes: VersionsGraphResponseGraphWorkflowNodesItemCase6CatchBlockNodesList, type: VersionsGraphResponseGraphWorkflowNodesItemCase6CatchBlockType, }), ).annotate({ identifier: "VersionsGraphResponseGraphWorkflowNodesItemCase6CatchBlock", }) as any as S.Schema; export type VersionsGraphResponseGraphWorkflowNodesItemCase6FinallyBlockNodesList = Array; export const VersionsGraphResponseGraphWorkflowNodesItemCase6FinallyBlockNodesList = /*@__PURE__*/ S.Array( S.Unknown, ) as any as S.Schema; export type VersionsGraphResponseGraphWorkflowNodesItemCase6FinallyBlockType = "block"; export const VersionsGraphResponseGraphWorkflowNodesItemCase6FinallyBlockType = /*@__PURE__*/ S.String; export interface VersionsGraphResponseGraphWorkflowNodesItemCase6FinallyBlock { /** Child nodes (recursive). */ nodes: VersionsGraphResponseGraphWorkflowNodesItemCase6FinallyBlockNodesList; type: VersionsGraphResponseGraphWorkflowNodesItemCase6FinallyBlockType; } export const VersionsGraphResponseGraphWorkflowNodesItemCase6FinallyBlock = /*@__PURE__*/ S.suspend(() => S.Struct({ nodes: VersionsGraphResponseGraphWorkflowNodesItemCase6FinallyBlockNodesList, type: VersionsGraphResponseGraphWorkflowNodesItemCase6FinallyBlockType, }), ).annotate({ identifier: "VersionsGraphResponseGraphWorkflowNodesItemCase6FinallyBlock", }) as any as S.Schema; export type VersionsGraphResponseGraphWorkflowNodesItemCase6TryBlockNodesList = Array; export const VersionsGraphResponseGraphWorkflowNodesItemCase6TryBlockNodesList = /*@__PURE__*/ S.Array( S.Unknown, ) as any as S.Schema; export type VersionsGraphResponseGraphWorkflowNodesItemCase6TryBlockType = "block"; export const VersionsGraphResponseGraphWorkflowNodesItemCase6TryBlockType = /*@__PURE__*/ S.String; export interface VersionsGraphResponseGraphWorkflowNodesItemCase6TryBlock { /** Child nodes (recursive). */ nodes: VersionsGraphResponseGraphWorkflowNodesItemCase6TryBlockNodesList; type: VersionsGraphResponseGraphWorkflowNodesItemCase6TryBlockType; } export const VersionsGraphResponseGraphWorkflowNodesItemCase6TryBlock = /*@__PURE__*/ S.suspend(() => S.Struct({ nodes: VersionsGraphResponseGraphWorkflowNodesItemCase6TryBlockNodesList, type: VersionsGraphResponseGraphWorkflowNodesItemCase6TryBlockType, }), ).annotate({ identifier: "VersionsGraphResponseGraphWorkflowNodesItemCase6TryBlock", }) as any as S.Schema; export type VersionsGraphResponseGraphWorkflowNodesItemCase6Type = "try"; export const VersionsGraphResponseGraphWorkflowNodesItemCase6Type = /*@__PURE__*/ S.String; export interface VersionsGraphResponseGraphWorkflowNodesItemCase6 { catchBlock: VersionsGraphResponseGraphWorkflowNodesItemCase6CatchBlock; finallyBlock: VersionsGraphResponseGraphWorkflowNodesItemCase6FinallyBlock; tryBlock: VersionsGraphResponseGraphWorkflowNodesItemCase6TryBlock; type: VersionsGraphResponseGraphWorkflowNodesItemCase6Type; } export const VersionsGraphResponseGraphWorkflowNodesItemCase6 = /*@__PURE__*/ S.suspend(() => S.Struct({ catchBlock: VersionsGraphResponseGraphWorkflowNodesItemCase6CatchBlock.pipe( T.Body("catch_block"), ), finallyBlock: VersionsGraphResponseGraphWorkflowNodesItemCase6FinallyBlock.pipe( T.Body("finally_block"), ), tryBlock: VersionsGraphResponseGraphWorkflowNodesItemCase6TryBlock.pipe( T.Body("try_block"), ), type: VersionsGraphResponseGraphWorkflowNodesItemCase6Type, }), ).annotate({ identifier: "VersionsGraphResponseGraphWorkflowNodesItemCase6", }) as any as S.Schema; export type VersionsGraphResponseGraphWorkflowNodesItemCase7NodesList = Array; export const VersionsGraphResponseGraphWorkflowNodesItemCase7NodesList = /*@__PURE__*/ S.Array( S.Unknown, ) as any as S.Schema; export type VersionsGraphResponseGraphWorkflowNodesItemCase7Type = "block"; export const VersionsGraphResponseGraphWorkflowNodesItemCase7Type = /*@__PURE__*/ S.String; export interface VersionsGraphResponseGraphWorkflowNodesItemCase7 { /** Child nodes (recursive). */ nodes: VersionsGraphResponseGraphWorkflowNodesItemCase7NodesList; type: VersionsGraphResponseGraphWorkflowNodesItemCase7Type; } export const VersionsGraphResponseGraphWorkflowNodesItemCase7 = /*@__PURE__*/ S.suspend(() => S.Struct({ nodes: VersionsGraphResponseGraphWorkflowNodesItemCase7NodesList, type: VersionsGraphResponseGraphWorkflowNodesItemCase7Type, }), ).annotate({ identifier: "VersionsGraphResponseGraphWorkflowNodesItemCase7", }) as any as S.Schema; export type VersionsGraphResponseGraphWorkflowNodesItemCase8BranchesItemNodesList = Array; export const VersionsGraphResponseGraphWorkflowNodesItemCase8BranchesItemNodesList = /*@__PURE__*/ S.Array( S.Unknown, ) as any as S.Schema; export interface VersionsGraphResponseGraphWorkflowNodesItemCase8BranchesItem { condition: string; /** Child nodes (recursive). */ nodes: VersionsGraphResponseGraphWorkflowNodesItemCase8BranchesItemNodesList; } export const VersionsGraphResponseGraphWorkflowNodesItemCase8BranchesItem = /*@__PURE__*/ S.suspend(() => S.Struct({ condition: S.String, nodes: VersionsGraphResponseGraphWorkflowNodesItemCase8BranchesItemNodesList, }), ).annotate({ identifier: "VersionsGraphResponseGraphWorkflowNodesItemCase8BranchesItem", }) as any as S.Schema; export type VersionsGraphResponseGraphWorkflowNodesItemCase8BranchesList = Array; export const VersionsGraphResponseGraphWorkflowNodesItemCase8BranchesList = /*@__PURE__*/ S.Array( VersionsGraphResponseGraphWorkflowNodesItemCase8BranchesItem, ) as any as S.Schema; export type VersionsGraphResponseGraphWorkflowNodesItemCase8Type = "if"; export const VersionsGraphResponseGraphWorkflowNodesItemCase8Type = /*@__PURE__*/ S.String; export interface VersionsGraphResponseGraphWorkflowNodesItemCase8 { branches: VersionsGraphResponseGraphWorkflowNodesItemCase8BranchesList; type: VersionsGraphResponseGraphWorkflowNodesItemCase8Type; } export const VersionsGraphResponseGraphWorkflowNodesItemCase8 = /*@__PURE__*/ S.suspend(() => S.Struct({ branches: VersionsGraphResponseGraphWorkflowNodesItemCase8BranchesList, type: VersionsGraphResponseGraphWorkflowNodesItemCase8Type, }), ).annotate({ identifier: "VersionsGraphResponseGraphWorkflowNodesItemCase8", }) as any as S.Schema; export type VersionsGraphResponseGraphWorkflowNodesItemCase9BranchesItemNodesList = Array; export const VersionsGraphResponseGraphWorkflowNodesItemCase9BranchesItemNodesList = /*@__PURE__*/ S.Array( S.Unknown, ) as any as S.Schema; export interface VersionsGraphResponseGraphWorkflowNodesItemCase9BranchesItem { condition: string; /** Child nodes (recursive). */ nodes: VersionsGraphResponseGraphWorkflowNodesItemCase9BranchesItemNodesList; } export const VersionsGraphResponseGraphWorkflowNodesItemCase9BranchesItem = /*@__PURE__*/ S.suspend(() => S.Struct({ condition: S.String, nodes: VersionsGraphResponseGraphWorkflowNodesItemCase9BranchesItemNodesList, }), ).annotate({ identifier: "VersionsGraphResponseGraphWorkflowNodesItemCase9BranchesItem", }) as any as S.Schema; export type VersionsGraphResponseGraphWorkflowNodesItemCase9BranchesList = Array; export const VersionsGraphResponseGraphWorkflowNodesItemCase9BranchesList = /*@__PURE__*/ S.Array( VersionsGraphResponseGraphWorkflowNodesItemCase9BranchesItem, ) as any as S.Schema; export type VersionsGraphResponseGraphWorkflowNodesItemCase9Type = "switch"; export const VersionsGraphResponseGraphWorkflowNodesItemCase9Type = /*@__PURE__*/ S.String; export interface VersionsGraphResponseGraphWorkflowNodesItemCase9 { branches: VersionsGraphResponseGraphWorkflowNodesItemCase9BranchesList; discriminant: string; type: VersionsGraphResponseGraphWorkflowNodesItemCase9Type; } export const VersionsGraphResponseGraphWorkflowNodesItemCase9 = /*@__PURE__*/ S.suspend(() => S.Struct({ branches: VersionsGraphResponseGraphWorkflowNodesItemCase9BranchesList, discriminant: S.String, type: VersionsGraphResponseGraphWorkflowNodesItemCase9Type, }), ).annotate({ identifier: "VersionsGraphResponseGraphWorkflowNodesItemCase9", }) as any as S.Schema; export type VersionsGraphResponseGraphWorkflowNodesItemCase10FunctionsValueNodesList = Array; export const VersionsGraphResponseGraphWorkflowNodesItemCase10FunctionsValueNodesList = /*@__PURE__*/ S.Array( S.Unknown, ) as any as S.Schema; export type VersionsGraphResponseGraphWorkflowNodesItemCase10FunctionsValueType = "function_def"; export const VersionsGraphResponseGraphWorkflowNodesItemCase10FunctionsValueType = /*@__PURE__*/ S.String; export interface VersionsGraphResponseGraphWorkflowNodesItemCase10FunctionsValue { name: string; /** Child nodes (recursive). */ nodes: VersionsGraphResponseGraphWorkflowNodesItemCase10FunctionsValueNodesList; type: VersionsGraphResponseGraphWorkflowNodesItemCase10FunctionsValueType; } export const VersionsGraphResponseGraphWorkflowNodesItemCase10FunctionsValue = /*@__PURE__*/ S.suspend(() => S.Struct({ name: S.String, nodes: VersionsGraphResponseGraphWorkflowNodesItemCase10FunctionsValueNodesList, type: VersionsGraphResponseGraphWorkflowNodesItemCase10FunctionsValueType, }), ).annotate({ identifier: "VersionsGraphResponseGraphWorkflowNodesItemCase10FunctionsValue", }) as any as S.Schema; export type VersionsGraphResponseGraphWorkflowNodesItemCase10FunctionsMap = { [key: string]: | VersionsGraphResponseGraphWorkflowNodesItemCase10FunctionsValue | undefined; }; export const VersionsGraphResponseGraphWorkflowNodesItemCase10FunctionsMap = /*@__PURE__*/ S.Record( S.String, VersionsGraphResponseGraphWorkflowNodesItemCase10FunctionsValue, ) as any as S.Schema; export type VersionsGraphResponseGraphWorkflowNodesItemCase10NodesList = Array; export const VersionsGraphResponseGraphWorkflowNodesItemCase10NodesList = /*@__PURE__*/ S.Array( S.Unknown, ) as any as S.Schema; export type VersionsGraphResponseGraphWorkflowNodesItemCase10Type = "start"; export const VersionsGraphResponseGraphWorkflowNodesItemCase10Type = /*@__PURE__*/ S.String; export type VersionsGraphResponseGraphWorkflowNodesItemCase10PayloadTypeType = "unknown"; export const VersionsGraphResponseGraphWorkflowNodesItemCase10PayloadTypeType = /*@__PURE__*/ S.String; export interface VersionsGraphResponseGraphWorkflowNodesItemCase10PayloadType { type: VersionsGraphResponseGraphWorkflowNodesItemCase10PayloadTypeType; } export const VersionsGraphResponseGraphWorkflowNodesItemCase10PayloadType = /*@__PURE__*/ S.suspend(() => S.Struct({ type: VersionsGraphResponseGraphWorkflowNodesItemCase10PayloadTypeType, }), ).annotate({ identifier: "VersionsGraphResponseGraphWorkflowNodesItemCase10PayloadType", }) as any as S.Schema; export type VersionsGraphResponseGraphWorkflowNodesItemCase10PayloadCase1FieldsMap = { [key: string]: unknown | undefined }; export const VersionsGraphResponseGraphWorkflowNodesItemCase10PayloadCase1FieldsMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type VersionsGraphResponseGraphWorkflowNodesItemCase10PayloadCase1Type = "object"; export const VersionsGraphResponseGraphWorkflowNodesItemCase10PayloadCase1Type = /*@__PURE__*/ S.String; export interface VersionsGraphResponseGraphWorkflowNodesItemCase10PayloadCase1 { /** Nested JsonShape fields (recursive structure). */ fields: VersionsGraphResponseGraphWorkflowNodesItemCase10PayloadCase1FieldsMap; type: VersionsGraphResponseGraphWorkflowNodesItemCase10PayloadCase1Type; } export const VersionsGraphResponseGraphWorkflowNodesItemCase10PayloadCase1 = /*@__PURE__*/ S.suspend(() => S.Struct({ fields: VersionsGraphResponseGraphWorkflowNodesItemCase10PayloadCase1FieldsMap, type: VersionsGraphResponseGraphWorkflowNodesItemCase10PayloadCase1Type, }), ).annotate({ identifier: "VersionsGraphResponseGraphWorkflowNodesItemCase10PayloadCase1", }) as any as S.Schema; export type VersionsGraphResponseGraphWorkflowNodesItemCase10Payload = | VersionsGraphResponseGraphWorkflowNodesItemCase10PayloadType | VersionsGraphResponseGraphWorkflowNodesItemCase10PayloadCase1; export const VersionsGraphResponseGraphWorkflowNodesItemCase10Payload = /*@__PURE__*/ S.Unknown.pipe(T.UnionCases([["type"], ["fields", "type"]])); export interface VersionsGraphResponseGraphWorkflowNodesItemCase10 { className: string; functions: VersionsGraphResponseGraphWorkflowNodesItemCase10FunctionsMap; /** Child nodes (recursive). */ nodes: VersionsGraphResponseGraphWorkflowNodesItemCase10NodesList; type: VersionsGraphResponseGraphWorkflowNodesItemCase10Type; /** Shape descriptor for JSON payloads. */ payload?: VersionsGraphResponseGraphWorkflowNodesItemCase10Payload | null; } export const VersionsGraphResponseGraphWorkflowNodesItemCase10 = /*@__PURE__*/ S.suspend(() => S.Struct({ className: S.String.pipe(T.Body("class_name")), functions: VersionsGraphResponseGraphWorkflowNodesItemCase10FunctionsMap, nodes: VersionsGraphResponseGraphWorkflowNodesItemCase10NodesList, type: VersionsGraphResponseGraphWorkflowNodesItemCase10Type, payload: S.optional( S.NullOr(VersionsGraphResponseGraphWorkflowNodesItemCase10Payload), ), }), ).annotate({ identifier: "VersionsGraphResponseGraphWorkflowNodesItemCase10", }) as any as S.Schema; export type VersionsGraphResponseGraphWorkflowNodesItemCase11Type = "function_call"; export const VersionsGraphResponseGraphWorkflowNodesItemCase11Type = /*@__PURE__*/ S.String; export interface VersionsGraphResponseGraphWorkflowNodesItemCase11 { name: string; type: VersionsGraphResponseGraphWorkflowNodesItemCase11Type; resolves?: number | null; starts?: number | null; } export const VersionsGraphResponseGraphWorkflowNodesItemCase11 = /*@__PURE__*/ S.suspend(() => S.Struct({ name: S.String, type: VersionsGraphResponseGraphWorkflowNodesItemCase11Type, resolves: S.optional(S.NullOr(S.Number)), starts: S.optional(S.NullOr(S.Number)), }), ).annotate({ identifier: "VersionsGraphResponseGraphWorkflowNodesItemCase11", }) as any as S.Schema; export type VersionsGraphResponseGraphWorkflowNodesItemCase12NodesList = Array; export const VersionsGraphResponseGraphWorkflowNodesItemCase12NodesList = /*@__PURE__*/ S.Array( S.Unknown, ) as any as S.Schema; export type VersionsGraphResponseGraphWorkflowNodesItemCase12Type = "function_def"; export const VersionsGraphResponseGraphWorkflowNodesItemCase12Type = /*@__PURE__*/ S.String; export interface VersionsGraphResponseGraphWorkflowNodesItemCase12 { name: string; /** Child nodes (recursive). */ nodes: VersionsGraphResponseGraphWorkflowNodesItemCase12NodesList; type: VersionsGraphResponseGraphWorkflowNodesItemCase12Type; } export const VersionsGraphResponseGraphWorkflowNodesItemCase12 = /*@__PURE__*/ S.suspend(() => S.Struct({ name: S.String, nodes: VersionsGraphResponseGraphWorkflowNodesItemCase12NodesList, type: VersionsGraphResponseGraphWorkflowNodesItemCase12Type, }), ).annotate({ identifier: "VersionsGraphResponseGraphWorkflowNodesItemCase12", }) as any as S.Schema; export type VersionsGraphResponseGraphWorkflowNodesItemCase13Kind = | "break" | "return"; export const VersionsGraphResponseGraphWorkflowNodesItemCase13Kind = /*@__PURE__*/ S.String; export type VersionsGraphResponseGraphWorkflowNodesItemCase13Type = "break"; export const VersionsGraphResponseGraphWorkflowNodesItemCase13Type = /*@__PURE__*/ S.String; export interface VersionsGraphResponseGraphWorkflowNodesItemCase13 { /** Break or return from a loop. */ kind: VersionsGraphResponseGraphWorkflowNodesItemCase13Kind; type: VersionsGraphResponseGraphWorkflowNodesItemCase13Type; } export const VersionsGraphResponseGraphWorkflowNodesItemCase13 = /*@__PURE__*/ S.suspend(() => S.Struct({ kind: VersionsGraphResponseGraphWorkflowNodesItemCase13Kind, type: VersionsGraphResponseGraphWorkflowNodesItemCase13Type, }), ).annotate({ identifier: "VersionsGraphResponseGraphWorkflowNodesItemCase13", }) as any as S.Schema; export type VersionsGraphResponseGraphWorkflowNodesItem = | VersionsGraphResponseGraphWorkflowNodesItemCase0 | VersionsGraphResponseGraphWorkflowNodesItemCase1 | VersionsGraphResponseGraphWorkflowNodesItemCase2 | VersionsGraphResponseGraphWorkflowNodesItemCase3 | VersionsGraphResponseGraphWorkflowNodesItemCase4 | VersionsGraphResponseGraphWorkflowNodesItemCase5 | VersionsGraphResponseGraphWorkflowNodesItemCase6 | VersionsGraphResponseGraphWorkflowNodesItemCase7 | VersionsGraphResponseGraphWorkflowNodesItemCase8 | VersionsGraphResponseGraphWorkflowNodesItemCase9 | VersionsGraphResponseGraphWorkflowNodesItemCase10 | VersionsGraphResponseGraphWorkflowNodesItemCase11 | VersionsGraphResponseGraphWorkflowNodesItemCase12 | VersionsGraphResponseGraphWorkflowNodesItemCase13; export const VersionsGraphResponseGraphWorkflowNodesItem = /*@__PURE__*/ S.Unknown.pipe( T.UnionCases([ ["duration", "name", "type", "resolves", "starts"], ["config", "name", "nodes", "type", "resolves", "starts"], ["name", "options", "type", "payload", "resolves", "starts"], ["name", "timestamp", "type", "resolves", "starts"], ["nodes", "type"], ["kind", "nodes", "type"], ["catchBlock", "finallyBlock", "tryBlock", "type"], ["nodes", "type"], ["branches", "type"], ["branches", "discriminant", "type"], ["className", "functions", "nodes", "type", "payload"], ["name", "type", "resolves", "starts"], ["name", "nodes", "type"], ["kind", "type"], ]), ); export type VersionsGraphResponseGraphWorkflowNodesList = Array; export const VersionsGraphResponseGraphWorkflowNodesList = /*@__PURE__*/ S.Array( VersionsGraphResponseGraphWorkflowNodesItem, ) as any as S.Schema; export type VersionsGraphResponseGraphWorkflowPayloadTypeType = "unknown"; export const VersionsGraphResponseGraphWorkflowPayloadTypeType = /*@__PURE__*/ S.String; export interface VersionsGraphResponseGraphWorkflowPayloadType { type: VersionsGraphResponseGraphWorkflowPayloadTypeType; } export const VersionsGraphResponseGraphWorkflowPayloadType = /*@__PURE__*/ S.suspend(() => S.Struct({ type: VersionsGraphResponseGraphWorkflowPayloadTypeType, }), ).annotate({ identifier: "VersionsGraphResponseGraphWorkflowPayloadType", }) as any as S.Schema; export type VersionsGraphResponseGraphWorkflowPayloadCase1FieldsMap = { [key: string]: unknown | undefined; }; export const VersionsGraphResponseGraphWorkflowPayloadCase1FieldsMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type VersionsGraphResponseGraphWorkflowPayloadCase1Type = "object"; export const VersionsGraphResponseGraphWorkflowPayloadCase1Type = /*@__PURE__*/ S.String; export interface VersionsGraphResponseGraphWorkflowPayloadCase1 { /** Nested JsonShape fields (recursive structure). */ fields: VersionsGraphResponseGraphWorkflowPayloadCase1FieldsMap; type: VersionsGraphResponseGraphWorkflowPayloadCase1Type; } export const VersionsGraphResponseGraphWorkflowPayloadCase1 = /*@__PURE__*/ S.suspend(() => S.Struct({ fields: VersionsGraphResponseGraphWorkflowPayloadCase1FieldsMap, type: VersionsGraphResponseGraphWorkflowPayloadCase1Type, }), ).annotate({ identifier: "VersionsGraphResponseGraphWorkflowPayloadCase1", }) as any as S.Schema; export type VersionsGraphResponseGraphWorkflowPayload = | VersionsGraphResponseGraphWorkflowPayloadType | VersionsGraphResponseGraphWorkflowPayloadCase1; export const VersionsGraphResponseGraphWorkflowPayload = /*@__PURE__*/ S.Unknown.pipe(T.UnionCases([["type"], ["fields", "type"]])); export interface VersionsGraphResponseGraphWorkflow { className: string; functions: VersionsGraphResponseGraphWorkflowFunctionsMap; nodes: VersionsGraphResponseGraphWorkflowNodesList; /** Shape descriptor for JSON payloads. */ payload?: VersionsGraphResponseGraphWorkflowPayload | null; } export const VersionsGraphResponseGraphWorkflow = /*@__PURE__*/ S.suspend(() => S.Struct({ className: S.String.pipe(T.Body("class_name")), functions: VersionsGraphResponseGraphWorkflowFunctionsMap, nodes: VersionsGraphResponseGraphWorkflowNodesList, payload: S.optional(S.NullOr(VersionsGraphResponseGraphWorkflowPayload)), }), ).annotate({ identifier: "VersionsGraphResponseGraphWorkflow", }) as any as S.Schema; export interface VersionsGraphResponseGraph { version: number; /** A parsed workflow entrypoint with its step graph. */ workflow: VersionsGraphResponseGraphWorkflow; } export const VersionsGraphResponseGraph = /*@__PURE__*/ S.suspend(() => S.Struct({ version: S.Number, workflow: VersionsGraphResponseGraphWorkflow, }), ).annotate({ identifier: "VersionsGraphResponseGraph", }) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface GraphVersionResponse { id: string; className: string; createdOn: string; /** Versioned workflow graph payload. */ graph: VersionsGraphResponseGraph; modifiedOn: string; workflowId: string; } export const GraphVersionResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, className: S.String.pipe(T.Body("class_name")), createdOn: S.String.pipe(T.Body("created_on")), graph: VersionsGraphResponseGraph, modifiedOn: S.String.pipe(T.Body("modified_on")), workflowId: S.String.pipe(T.Body("workflow_id")), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GraphVersionResponse", }) as any as S.Schema; export type InstancesListRequestDirection = "asc" | "desc"; export const InstancesListRequestDirection = /*@__PURE__*/ S.String; export type InstancesListRequestStatus = | "queued" | "running" | "paused" | "errored" | "terminated" | "complete" | "waitingForPause" | "waiting" | "rollingBack"; export const InstancesListRequestStatus = /*@__PURE__*/ S.String; export interface ListInstancesRequest { accountId: string; workflowName: string; /** Opaque token for cursor-based pagination. Mutually exclusive with `page`. */ cursor?: string; /** Accepts ISO 8601 with no timezone offsets and in UTC. */ dateEnd?: string; /** Accepts ISO 8601 with no timezone offsets and in UTC. */ dateStart?: string; /** Defines the direction for cursor-based pagination. */ direction?: InstancesListRequestDirection | (string & {}); /** Deprecated: use `cursor` for pagination instead. */ page?: number; perPage?: number; status?: InstancesListRequestStatus | (string & {}); } export const ListInstancesRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), workflowName: S.String.pipe(T.Label("workflow_name")), cursor: S.optional(S.String.pipe(T.Query())), dateEnd: S.optional(S.String.pipe(T.Query("date_end"))), dateStart: S.optional(S.String.pipe(T.Query("date_start"))), direction: S.optional(InstancesListRequestDirection.pipe(T.Query())), page: S.optional(S.Number.pipe(T.Query())), perPage: S.optional(S.Number.pipe(T.Query("per_page"))), status: S.optional(InstancesListRequestStatus.pipe(T.Query())), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/workflows/{workflow_name}/instances", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListInstancesRequest", }) as any as S.Schema; export type InstancesListResultItemStatus = | "queued" | "running" | "paused" | "errored" | "terminated" | "complete" | "waitingForPause" | "waiting" | "rollingBack"; export const InstancesListResultItemStatus = /*@__PURE__*/ S.String; export type InstancesListResultItemTriggerSource = | "unknown" | "api" | "binding" | "event" | "cron"; export const InstancesListResultItemTriggerSource = /*@__PURE__*/ S.String; export interface InstancesListResultItem { id: string; createdOn: string; endedOn: string; modifiedOn: string; startedOn: string; status: InstancesListResultItemStatus; versionId: string; workflowId: string; triggerSource?: InstancesListResultItemTriggerSource | null; } export const InstancesListResultItem = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, createdOn: S.String.pipe(T.Body("created_on")), endedOn: S.String.pipe(T.Body("ended_on")), modifiedOn: S.String.pipe(T.Body("modified_on")), startedOn: S.String.pipe(T.Body("started_on")), status: InstancesListResultItemStatus, versionId: S.String.pipe(T.Body("version_id")), workflowId: S.String.pipe(T.Body("workflow_id")), triggerSource: S.optional( S.NullOr(InstancesListResultItemTriggerSource).pipe( T.Body("trigger_source"), ), ), }), ).annotate({ identifier: "InstancesListResultItem", }) as any as S.Schema; export type InstancesListResultList = Array; export const InstancesListResultList = /*@__PURE__*/ S.Array( InstancesListResultItem, ) as any as S.Schema; export interface ListInstancesResponse { /** The unwrapped `result` payload of the v4 response envelope. */ result: InstancesListResultList; /** Pagination info from the envelope's `result_info`. */ resultInfo?: ResultInfo | null; } export const ListInstancesResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ result: InstancesListResultList.pipe(T.EnvelopePayload()), resultInfo: S.optional(S.NullOr(ResultInfo).pipe(T.ResultInfo())), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListInstancesResponse", }) as any as S.Schema; export interface ListVersionsRequest { accountId: string; workflowName: string; page?: number; perPage?: number; } export const ListVersionsRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), workflowName: S.String.pipe(T.Label("workflow_name")), page: S.optional(S.Number.pipe(T.Query())), perPage: S.optional(S.Number.pipe(T.Query("per_page"))), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/workflows/{workflow_name}/versions", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListVersionsRequest", }) as any as S.Schema; export type VersionsListResultItemLanguage = "javascript" | "python"; export const VersionsListResultItemLanguage = /*@__PURE__*/ S.String; export type VersionsListResultItemLimits = VersionsGetResponseLimits; export const VersionsListResultItemLimits = VersionsGetResponseLimits; export interface VersionsListResultItem { id: string; className: string; createdOn: string; hasDag: boolean; /** The programming language of the workflow implementation */ language: VersionsListResultItemLanguage; modifiedOn: string; workflowId: string; limits?: VersionsGetResponseLimits | null; } export const VersionsListResultItem = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, className: S.String.pipe(T.Body("class_name")), createdOn: S.String.pipe(T.Body("created_on")), hasDag: S.Boolean.pipe(T.Body("has_dag")), language: VersionsListResultItemLanguage, modifiedOn: S.String.pipe(T.Body("modified_on")), workflowId: S.String.pipe(T.Body("workflow_id")), limits: S.optional(S.NullOr(VersionsGetResponseLimits)), }), ).annotate({ identifier: "VersionsListResultItem", }) as any as S.Schema; export type VersionsListResultList = Array; export const VersionsListResultList = /*@__PURE__*/ S.Array( VersionsListResultItem, ) as any as S.Schema; export interface ListVersionsResponse { /** The unwrapped `result` payload of the v4 response envelope. */ result: VersionsListResultList; /** Pagination info from the envelope's `result_info`. */ resultInfo?: ResultInfo | null; } export const ListVersionsResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ result: VersionsListResultList.pipe(T.EnvelopePayload()), resultInfo: S.optional(S.NullOr(ResultInfo).pipe(T.ResultInfo())), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListVersionsResponse", }) as any as S.Schema; export interface ListWorkflowsRequest { accountId: string; page?: number; perPage?: number; /** Allows filtering workflows` name. */ search?: string; } export const ListWorkflowsRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), page: S.optional(S.Number.pipe(T.Query())), perPage: S.optional(S.Number.pipe(T.Query("per_page"))), search: S.optional(S.String.pipe(T.Query())), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/workflows", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListWorkflowsRequest", }) as any as S.Schema; export type ListResultItemInstances = GetResponseInstances; export const ListResultItemInstances = GetResponseInstances; export type ListResultItemSchedulesItem = GetResponseSchedulesItem; export const ListResultItemSchedulesItem = GetResponseSchedulesItem; export type ListResultItemSchedulesList = Array; export const ListResultItemSchedulesList = /*@__PURE__*/ S.Array( GetResponseSchedulesItem, ) as any as S.Schema; export interface ListResultItem { id: string; className: string; createdOn: string; instances: GetResponseInstances; modifiedOn: string; name: string; scriptName: string; triggeredOn: string; schedules?: ListResultItemSchedulesList | null; } export const ListResultItem = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, className: S.String.pipe(T.Body("class_name")), createdOn: S.String.pipe(T.Body("created_on")), instances: GetResponseInstances, modifiedOn: S.String.pipe(T.Body("modified_on")), name: S.String, scriptName: S.String.pipe(T.Body("script_name")), triggeredOn: S.String.pipe(T.Body("triggered_on")), schedules: S.optional(S.NullOr(ListResultItemSchedulesList)), }), ).annotate({ identifier: "ListResultItem" }) as any as S.Schema; export type ListResultList = Array; export const ListResultList = /*@__PURE__*/ S.Array( ListResultItem, ) as any as S.Schema; export interface ListWorkflowsResponse { /** The unwrapped `result` payload of the v4 response envelope. */ result: ListResultList; /** Pagination info from the envelope's `result_info`. */ resultInfo?: ResultInfo | null; } export const ListWorkflowsResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ result: ListResultList.pipe(T.EnvelopePayload()), resultInfo: S.optional(S.NullOr(ResultInfo).pipe(T.ResultInfo())), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListWorkflowsResponse", }) as any as S.Schema; export type InstancesStatusEditRequestStatus = | "pause" | "resume" | "terminate" | "restart"; export const InstancesStatusEditRequestStatus = /*@__PURE__*/ S.String; export type InstancesStatusEditRequestFromType = | "do" | "sleep" | "waitForEvent"; export const InstancesStatusEditRequestFromType = /*@__PURE__*/ S.String; export interface InstancesStatusEditRequestFrom { name: string; count?: number; type?: InstancesStatusEditRequestFromType | (string & {}); } export const InstancesStatusEditRequestFrom = /*@__PURE__*/ S.suspend(() => S.Struct({ name: S.String, count: S.optional(S.Number), type: S.optional(InstancesStatusEditRequestFromType), }), ).annotate({ identifier: "InstancesStatusEditRequestFrom", }) as any as S.Schema; export interface PatchInstanceStatusRequest { accountId: string; workflowName: string; /** Instance identifier. User-created instances match `^[a-zA-Z0-9_][a-zA-Z0-9-_]*$` (max 100 characters); cron-triggered instances can use a longer, system-generated id derived from the cron expression. */ instanceId: string; status?: InstancesStatusEditRequestStatus | (string & {}); /** Run rollback before terminating. */ rollback?: boolean; /** Step to restart from. */ from?: InstancesStatusEditRequestFrom; } export const PatchInstanceStatusRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), workflowName: S.String.pipe(T.Label("workflow_name")), instanceId: S.String.pipe(T.Label("instance_id")), status: S.optional(InstancesStatusEditRequestStatus), rollback: S.optional(S.Boolean), from: S.optional(InstancesStatusEditRequestFrom), }) .pipe( T.Http({ method: "PATCH", uri: "/accounts/{account_id}/workflows/{workflow_name}/instances/{instance_id}/status", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "PatchInstanceStatusRequest", }) as any as S.Schema; export type InstancesStatusEditResponseStatus = | "queued" | "running" | "paused" | "errored" | "terminated" | "complete" | "waitingForPause" | "waiting" | "rollingBack"; export const InstancesStatusEditResponseStatus = /*@__PURE__*/ S.String; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface PatchInstanceStatusResponse { status: InstancesStatusEditResponseStatus; /** Accepts ISO 8601 with no timezone offsets and in UTC. */ timestamp: string; } export const PatchInstanceStatusResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ status: InstancesStatusEditResponseStatus, timestamp: S.String, }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "PatchInstanceStatusResponse", }) as any as S.Schema; export interface UpdateRequestLimits { steps?: number; } export const UpdateRequestLimits = /*@__PURE__*/ S.suspend(() => S.Struct({ steps: S.optional(S.Number), }), ).annotate({ identifier: "UpdateRequestLimits", }) as any as S.Schema; export interface UpdateRequestSchedulesItem { cron: string; } export const UpdateRequestSchedulesItem = /*@__PURE__*/ S.suspend(() => S.Struct({ cron: S.String, }), ).annotate({ identifier: "UpdateRequestSchedulesItem", }) as any as S.Schema; export type UpdateRequestSchedulesList = Array; export const UpdateRequestSchedulesList = /*@__PURE__*/ S.Array( UpdateRequestSchedulesItem, ) as any as S.Schema; export interface PutWorkflowRequest { accountId: string; workflowName: string; className: string; scriptName: string; limits?: UpdateRequestLimits; schedules?: UpdateRequestSchedulesList; } export const PutWorkflowRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), workflowName: S.String.pipe(T.Label("workflow_name")), className: S.String.pipe(T.Body("class_name")), scriptName: S.String.pipe(T.Body("script_name")), limits: S.optional(UpdateRequestLimits), schedules: S.optional(UpdateRequestSchedulesList), }) .pipe( T.Http({ method: "PUT", uri: "/accounts/{account_id}/workflows/{workflow_name}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "PutWorkflowRequest", }) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface PutWorkflowResponse { id: string; className: string; createdOn: string; isDeleted: number; modifiedOn: string; name: string; scriptName: string; terminatorRunning: number; triggeredOn: string; versionId: string; } export const PutWorkflowResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, className: S.String.pipe(T.Body("class_name")), createdOn: S.String.pipe(T.Body("created_on")), isDeleted: S.Number.pipe(T.Body("is_deleted")), modifiedOn: S.String.pipe(T.Body("modified_on")), name: S.String, scriptName: S.String.pipe(T.Body("script_name")), terminatorRunning: S.Number.pipe(T.Body("terminator_running")), triggeredOn: S.String.pipe(T.Body("triggered_on")), versionId: S.String.pipe(T.Body("version_id")), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "PutWorkflowResponse", }) as any as S.Schema; export type InstancesStepRequestType = "step" | "waitForEvent"; export const InstancesStepRequestType = /*@__PURE__*/ S.String; export interface StepInstanceRequest { accountId: string; workflowName: string; /** Instance identifier. User-created instances match `^[a-zA-Z0-9_][a-zA-Z0-9-_]*$` (max 100 characters); cron-triggered instances can use a longer, system-generated id derived from the cron expression. */ instanceId: string; /** Exact step name from the instance logs response, including the generated counter suffix. */ name: string; /** Step type to disambiguate step.do and waitForEvent entries that share the same name. */ type: InstancesStepRequestType | (string & {}); /** Specific attempt number to retrieve output or error for. */ attempt?: number; } export const StepInstanceRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), workflowName: S.String.pipe(T.Label("workflow_name")), instanceId: S.String.pipe(T.Label("instance_id")), name: S.String.pipe(T.Query()), type: InstancesStepRequestType.pipe(T.Query()), attempt: S.optional(S.Number.pipe(T.Query())), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/workflows/{workflow_name}/instances/{instance_id}/step", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "StepInstanceRequest", }) as any as S.Schema; export type InstancesStepResponseError = InstancesGetResponseError; export const InstancesStepResponseError = InstancesGetResponseError; export type InstancesStepResponseStatus = | "queued" | "running" | "paused" | "errored" | "terminated" | "complete" | "waitingForPause" | "waiting" | "rollingBack"; export const InstancesStepResponseStatus = /*@__PURE__*/ S.String; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface StepInstanceResponse { /** Error details when status='errored'; null otherwise. */ error: InstancesGetResponseError; status: InstancesStepResponseStatus; /** Full step output or waitForEvent payload without truncation. Sensitive outputs are returned as '[REDACTED]'. Populated when status='complete'. May be a ReadableStream when the step returned one from step.do; stream outputs are served as application/octet-stream rather than JSON. */ output?: unknown | null; } export const StepInstanceResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ error: InstancesGetResponseError, status: InstancesStepResponseStatus, output: S.optional(S.NullOr(S.Unknown)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "StepInstanceResponse", }) as any as S.Schema; export type BulkInstanceError = | WorkflowNotFound | InstanceAlreadyExists | InvalidRoute | InvalidBody | CloudflareOpError; /** Creates multiple workflow instances in a single batch operation. */ export const bulkInstance: API.PaginatedOperationMethod< BulkInstanceRequest, BulkInstanceResponse, BulkInstanceError, CloudflareOpContext, InstancesBulkResultItem > = /*@__PURE__*/ API.makePaginated( () => ({ input: BulkInstanceRequest, output: BulkInstanceResponse, errors: [ WorkflowNotFound, InstanceAlreadyExists, InvalidRoute, InvalidBody, CloudflareRateLimited, CloudflareError, ], protocol: CloudflarePaginatedProtocol, retry: Retry.Retry, pagination: { mode: "single", items: "result" } as const, }), cloudflarePaginate, ) as any; export type CreateInstanceError = | WorkflowNotFound | InstanceAlreadyExists | InvalidRoute | InvalidBody | CloudflareOpError; /** Creates a new instance of a workflow, starting its execution. */ export const createInstance: API.OperationMethod< CreateInstanceRequest, CreateInstanceResponse, CreateInstanceError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: CreateInstanceRequest, output: CreateInstanceResponse, errors: [ WorkflowNotFound, InstanceAlreadyExists, InvalidRoute, InvalidBody, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type CreateInstanceEventError = | WorkflowNotFound | InvalidRoute | InstanceNotFound | InvalidBody | CloudflareOpError; /** Sends an event to a running workflow instance to trigger state transitions. */ export const createInstanceEvent: API.OperationMethod< CreateInstanceEventRequest, CreateInstanceEventResponse, CreateInstanceEventError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: CreateInstanceEventRequest, output: CreateInstanceEventResponse, errors: [ WorkflowNotFound, InvalidRoute, InstanceNotFound, InvalidBody, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type DeleteWorkflowError = | WorkflowNotFound | InvalidRoute | CloudflareOpError; /** Deletes a Workflow. This only deletes the Workflow and does not delete or modify any Worker associated to this Workflow or bounded to it. */ export const deleteWorkflow: API.OperationMethod< DeleteWorkflowRequest, DeleteWorkflowResponse, DeleteWorkflowError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: DeleteWorkflowRequest, output: DeleteWorkflowResponse, errors: [ WorkflowNotFound, InvalidRoute, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetInstanceError = | WorkflowNotFound | InvalidRoute | InstanceNotFound | CloudflareOpError; /** Retrieves logs and execution status for a specific workflow instance. */ export const getInstance: API.OperationMethod< GetInstanceRequest, GetInstanceResponse, GetInstanceError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetInstanceRequest, output: GetInstanceResponse, errors: [ WorkflowNotFound, InvalidRoute, InstanceNotFound, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetVersionError = | WorkflowNotFound | InvalidRoute | VersionNotFound | CloudflareOpError; /** Retrieves details for a specific deployed workflow version. */ export const getVersion: API.OperationMethod< GetVersionRequest, GetVersionResponse, GetVersionError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetVersionRequest, output: GetVersionResponse, errors: [ WorkflowNotFound, InvalidRoute, VersionNotFound, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetWorkflowError = | WorkflowNotFound | InvalidRoute | CloudflareOpError; /** Retrieves configuration and metadata for a specific workflow. */ export const getWorkflow: API.OperationMethod< GetWorkflowRequest, GetWorkflowResponse, GetWorkflowError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetWorkflowRequest, output: GetWorkflowResponse, errors: [ WorkflowNotFound, InvalidRoute, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GraphVersionError = CloudflareOpError; /** Retrieves the graph visualization of a workflow version. */ export const graphVersion: API.OperationMethod< GraphVersionRequest, GraphVersionResponse, GraphVersionError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GraphVersionRequest, output: GraphVersionResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type ListInstancesError = | WorkflowNotFound | WorkflowInternalError | InvalidRoute | InvalidBody | CloudflareOpError; /** Lists all instances of a workflow with their execution status. */ export const listInstances: API.PaginatedOperationMethod< ListInstancesRequest, ListInstancesResponse, ListInstancesError, CloudflareOpContext, InstancesListResultItem > = /*@__PURE__*/ API.makePaginated( () => ({ input: ListInstancesRequest, output: ListInstancesResponse, errors: [ WorkflowNotFound, WorkflowInternalError, InvalidRoute, InvalidBody, CloudflareRateLimited, CloudflareError, ], protocol: CloudflarePaginatedProtocol, retry: Retry.Retry, pagination: { mode: "page", inputToken: "page", outputToken: "resultInfo.page", items: "result", pageSize: "perPage", } as const, }), cloudflarePaginate, ) as any; export type ListVersionsError = | WorkflowNotFound | InvalidRoute | CloudflareOpError; /** Lists all deployed versions of a workflow. */ export const listVersions: API.PaginatedOperationMethod< ListVersionsRequest, ListVersionsResponse, ListVersionsError, CloudflareOpContext, VersionsListResultItem > = /*@__PURE__*/ API.makePaginated( () => ({ input: ListVersionsRequest, output: ListVersionsResponse, errors: [ WorkflowNotFound, InvalidRoute, CloudflareRateLimited, CloudflareError, ], protocol: CloudflarePaginatedProtocol, retry: Retry.Retry, pagination: { mode: "page", inputToken: "page", outputToken: "resultInfo.page", items: "result", pageSize: "perPage", } as const, }), cloudflarePaginate, ) as any; export type ListWorkflowsError = CloudflareOpError; /** Lists all workflows configured for the account. */ export const listWorkflows: API.PaginatedOperationMethod< ListWorkflowsRequest, ListWorkflowsResponse, ListWorkflowsError, CloudflareOpContext, ListResultItem > = /*@__PURE__*/ API.makePaginated( () => ({ input: ListWorkflowsRequest, output: ListWorkflowsResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflarePaginatedProtocol, retry: Retry.Retry, pagination: { mode: "page", inputToken: "page", outputToken: "resultInfo.page", items: "result", pageSize: "perPage", } as const, }), cloudflarePaginate, ) as any; export type PatchInstanceStatusError = | WorkflowNotFound | InvalidRoute | InstanceNotFound | InstanceCannotTerminate | CloudflareOpError; /** Changes the execution status of a workflow instance (e.g., pause, resume, terminate). */ export const patchInstanceStatus: API.OperationMethod< PatchInstanceStatusRequest, PatchInstanceStatusResponse, PatchInstanceStatusError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: PatchInstanceStatusRequest, output: PatchInstanceStatusResponse, errors: [ WorkflowNotFound, InvalidRoute, InstanceNotFound, InstanceCannotTerminate, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type PutWorkflowError = | WorkflowInternalError | InvalidRoute | CloudflareOpError; /** Creates a new workflow or updates an existing workflow definition. */ export const putWorkflow: API.OperationMethod< PutWorkflowRequest, PutWorkflowResponse, PutWorkflowError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: PutWorkflowRequest, output: PutWorkflowResponse, errors: [ WorkflowInternalError, InvalidRoute, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type StepInstanceError = CloudflareOpError; /** Retrieves the full, untruncated output for a specific step on a workflow instance. Returns a flat status-shaped JSON body with step `status` ('running' | 'waiting' | 'complete' | 'errored'), `error` (nullable), and `output` (the step value, or null while running/waiting/errored). When the step returned a ReadableStream from step.do, the response is served as 'application/octet-stream' with the raw bytes as the body instead of JSON. A `status='running'` response with non-null `error` indicates the step is currently retrying after a prior attempt failed. */ export const stepInstance: API.OperationMethod< StepInstanceRequest, StepInstanceResponse, StepInstanceError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: StepInstanceRequest, output: StepInstanceResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, }));