# Workflows ## List all Workflows `workflows.list(WorkflowListParams**kwargs) -> SyncV4PagePaginationArray[WorkflowListResponse]` **get** `/accounts/{account_id}/workflows` Lists all workflows configured for the account. ### Parameters - `account_id: str` - `page: Optional[float]` - `per_page: Optional[float]` - `search: Optional[str]` Allows filtering workflows` name. ### Returns - `class WorkflowListResponse: …` - `id: str` - `class_name: str` - `created_on: datetime` - `instances: Instances` - `complete: Optional[float]` - `errored: Optional[float]` - `paused: Optional[float]` - `queued: Optional[float]` - `rolling_back: Optional[float]` - `running: Optional[float]` - `terminated: Optional[float]` - `waiting: Optional[float]` - `waiting_for_pause: Optional[float]` - `modified_on: datetime` - `name: str` - `script_name: str` - `triggered_on: Optional[datetime]` - `schedules: Optional[List[Schedule]]` - `cron: str` - `next_instance: str` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) page = client.workflows.list( account_id="account_id", ) page = page.result[0] print(page.id) ``` #### Response ```json { "errors": [ { "code": 0, "message": "message" } ], "messages": [ { "code": 0, "message": "message" } ], "result": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "class_name": "class_name", "created_on": "2019-12-27T18:11:19.117Z", "instances": { "complete": 0, "errored": 0, "paused": 0, "queued": 0, "rollingBack": 0, "running": 0, "terminated": 0, "waiting": 0, "waitingForPause": 0 }, "modified_on": "2019-12-27T18:11:19.117Z", "name": "x", "script_name": "script_name", "triggered_on": "2019-12-27T18:11:19.117Z", "schedules": [ { "cron": "cron", "next_instance": "next_instance" } ] } ], "success": true, "result_info": { "count": 0, "per_page": 0, "total_count": 0, "cursor": "cursor", "page": 0, "total_pages": 0 } } ``` ## Get Workflow details `workflows.get(strworkflow_name, WorkflowGetParams**kwargs) -> WorkflowGetResponse` **get** `/accounts/{account_id}/workflows/{workflow_name}` Retrieves configuration and metadata for a specific workflow. ### Parameters - `account_id: str` - `workflow_name: str` ### Returns - `class WorkflowGetResponse: …` - `id: str` - `class_name: str` - `created_on: datetime` - `instances: Instances` - `complete: Optional[float]` - `errored: Optional[float]` - `paused: Optional[float]` - `queued: Optional[float]` - `rolling_back: Optional[float]` - `running: Optional[float]` - `terminated: Optional[float]` - `waiting: Optional[float]` - `waiting_for_pause: Optional[float]` - `modified_on: datetime` - `name: str` - `script_name: str` - `triggered_on: Optional[datetime]` - `schedules: Optional[List[Schedule]]` - `cron: str` - `next_instance: str` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) workflow = client.workflows.get( workflow_name="x", account_id="account_id", ) print(workflow.id) ``` #### Response ```json { "errors": [ { "code": 0, "message": "message" } ], "messages": [ { "code": 0, "message": "message" } ], "result": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "class_name": "class_name", "created_on": "2019-12-27T18:11:19.117Z", "instances": { "complete": 0, "errored": 0, "paused": 0, "queued": 0, "rollingBack": 0, "running": 0, "terminated": 0, "waiting": 0, "waitingForPause": 0 }, "modified_on": "2019-12-27T18:11:19.117Z", "name": "x", "script_name": "script_name", "triggered_on": "2019-12-27T18:11:19.117Z", "schedules": [ { "cron": "cron", "next_instance": "next_instance" } ] }, "success": true, "result_info": { "count": 0, "per_page": 0, "total_count": 0, "cursor": "cursor", "page": 0, "total_pages": 0 } } ``` ## Create/modify Workflow `workflows.update(strworkflow_name, WorkflowUpdateParams**kwargs) -> WorkflowUpdateResponse` **put** `/accounts/{account_id}/workflows/{workflow_name}` Creates a new workflow or updates an existing workflow definition. ### Parameters - `account_id: str` - `workflow_name: str` - `class_name: str` - `script_name: str` - `limits: Optional[Limits]` - `steps: Optional[int]` - `schedules: Optional[Iterable[Schedule]]` - `cron: str` ### Returns - `class WorkflowUpdateResponse: …` - `id: str` - `class_name: str` - `created_on: datetime` - `is_deleted: float` - `modified_on: datetime` - `name: str` - `script_name: str` - `terminator_running: float` - `triggered_on: Optional[datetime]` - `version_id: str` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) workflow = client.workflows.update( workflow_name="x", account_id="account_id", class_name="x", script_name="x", ) print(workflow.id) ``` #### Response ```json { "errors": [ { "code": 0, "message": "message" } ], "messages": [ { "code": 0, "message": "message" } ], "result": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "class_name": "class_name", "created_on": "2019-12-27T18:11:19.117Z", "is_deleted": 0, "modified_on": "2019-12-27T18:11:19.117Z", "name": "x", "script_name": "script_name", "terminator_running": 0, "triggered_on": "2019-12-27T18:11:19.117Z", "version_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" }, "success": true, "result_info": { "count": 0, "per_page": 0, "total_count": 0, "cursor": "cursor", "page": 0, "total_pages": 0 } } ``` ## Deletes a Workflow `workflows.delete(strworkflow_name, WorkflowDeleteParams**kwargs) -> WorkflowDeleteResponse` **delete** `/accounts/{account_id}/workflows/{workflow_name}` Deletes a Workflow. This only deletes the Workflow and does not delete or modify any Worker associated to this Workflow or bounded to it. ### Parameters - `account_id: str` - `workflow_name: str` ### Returns - `class WorkflowDeleteResponse: …` - `status: Literal["ok"]` - `"ok"` - `success: Optional[bool]` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) workflow = client.workflows.delete( workflow_name="x", account_id="account_id", ) print(workflow.status) ``` #### Response ```json { "errors": [ { "code": 0, "message": "message" } ], "messages": [ { "code": 0, "message": "message" } ], "result": { "status": "ok", "success": true }, "success": true, "result_info": { "count": 0, "per_page": 0, "total_count": 0, "cursor": "cursor", "page": 0, "total_pages": 0 } } ``` ## Domain Types ### Workflow List Response - `class WorkflowListResponse: …` - `id: str` - `class_name: str` - `created_on: datetime` - `instances: Instances` - `complete: Optional[float]` - `errored: Optional[float]` - `paused: Optional[float]` - `queued: Optional[float]` - `rolling_back: Optional[float]` - `running: Optional[float]` - `terminated: Optional[float]` - `waiting: Optional[float]` - `waiting_for_pause: Optional[float]` - `modified_on: datetime` - `name: str` - `script_name: str` - `triggered_on: Optional[datetime]` - `schedules: Optional[List[Schedule]]` - `cron: str` - `next_instance: str` ### Workflow Get Response - `class WorkflowGetResponse: …` - `id: str` - `class_name: str` - `created_on: datetime` - `instances: Instances` - `complete: Optional[float]` - `errored: Optional[float]` - `paused: Optional[float]` - `queued: Optional[float]` - `rolling_back: Optional[float]` - `running: Optional[float]` - `terminated: Optional[float]` - `waiting: Optional[float]` - `waiting_for_pause: Optional[float]` - `modified_on: datetime` - `name: str` - `script_name: str` - `triggered_on: Optional[datetime]` - `schedules: Optional[List[Schedule]]` - `cron: str` - `next_instance: str` ### Workflow Update Response - `class WorkflowUpdateResponse: …` - `id: str` - `class_name: str` - `created_on: datetime` - `is_deleted: float` - `modified_on: datetime` - `name: str` - `script_name: str` - `terminator_running: float` - `triggered_on: Optional[datetime]` - `version_id: str` ### Workflow Delete Response - `class WorkflowDeleteResponse: …` - `status: Literal["ok"]` - `"ok"` - `success: Optional[bool]` # Instances ## List of workflow instances `workflows.instances.list(strworkflow_name, InstanceListParams**kwargs) -> SyncV4PagePaginationArray[InstanceListResponse]` **get** `/accounts/{account_id}/workflows/{workflow_name}/instances` Lists all instances of a workflow with their execution status. ### Parameters - `account_id: str` - `workflow_name: str` - `cursor: Optional[str]` Opaque token for cursor-based pagination. Mutually exclusive with `page`. - `date_end: Optional[Union[str, datetime]]` Accepts ISO 8601 with no timezone offsets and in UTC. - `date_start: Optional[Union[str, datetime]]` Accepts ISO 8601 with no timezone offsets and in UTC. - `direction: Optional[Literal["asc", "desc"]]` Defines the direction for cursor-based pagination. - `"asc"` - `"desc"` - `page: Optional[float]` Deprecated: use `cursor` for pagination instead. - `per_page: Optional[float]` - `status: Optional[Literal["queued", "running", "paused", 6 more]]` - `"queued"` - `"running"` - `"paused"` - `"errored"` - `"terminated"` - `"complete"` - `"waitingForPause"` - `"waiting"` - `"rollingBack"` ### Returns - `class InstanceListResponse: …` - `id: str` - `created_on: datetime` - `ended_on: Optional[datetime]` - `modified_on: datetime` - `started_on: Optional[datetime]` - `status: Literal["queued", "running", "paused", 6 more]` - `"queued"` - `"running"` - `"paused"` - `"errored"` - `"terminated"` - `"complete"` - `"waitingForPause"` - `"waiting"` - `"rollingBack"` - `version_id: str` - `workflow_id: str` - `trigger_source: Optional[Literal["unknown", "api", "binding", 2 more]]` - `"unknown"` - `"api"` - `"binding"` - `"event"` - `"cron"` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) page = client.workflows.instances.list( workflow_name="x", account_id="account_id", ) page = page.result[0] print(page.id) ``` #### Response ```json { "errors": [ { "code": 0, "message": "message" } ], "messages": [ { "code": 0, "message": "message" } ], "result": [ { "id": "x", "created_on": "2019-12-27T18:11:19.117Z", "ended_on": "2019-12-27T18:11:19.117Z", "modified_on": "2019-12-27T18:11:19.117Z", "started_on": "2019-12-27T18:11:19.117Z", "status": "queued", "version_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "workflow_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "trigger_source": "unknown" } ], "success": true, "result_info": { "count": 0, "per_page": 0, "total_count": 0, "cursor": "cursor", "page": 0, "total_pages": 0 } } ``` ## Get logs and status from instance `workflows.instances.get(strinstance_id, InstanceGetParams**kwargs) -> InstanceGetResponse` **get** `/accounts/{account_id}/workflows/{workflow_name}/instances/{instance_id}` Retrieves logs and execution status for a specific workflow instance. ### Parameters - `account_id: str` - `workflow_name: str` - `instance_id: str` 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. - `order: Optional[Literal["asc", "desc"]]` Step ordering: "asc" (default, oldest first) or "desc" (newest first). - `"asc"` - `"desc"` - `simple: Optional[Literal["true", "false"]]` When true, omits step details and returns only metadata with step_count. - `"true"` - `"false"` ### Returns - `class InstanceGetResponse: …` - `end: Optional[datetime]` - `error: Optional[Error]` - `message: str` - `name: str` - `output: Union[str, float]` - `str` - `float` - `params: object` - `queued: datetime` - `rollback: Optional[Rollback]` - `error: Optional[RollbackError]` - `message: str` - `name: str` - `outcome: Literal["complete", "failed"]` - `"complete"` - `"failed"` - `start: Optional[datetime]` - `status: Literal["queued", "running", "paused", 6 more]` - `"queued"` - `"running"` - `"paused"` - `"errored"` - `"terminated"` - `"complete"` - `"waitingForPause"` - `"waiting"` - `"rollingBack"` - `step_count: int` - `steps: List[Step]` - `class StepUnionMember0: …` - `attempts: List[StepUnionMember0Attempt]` - `end: Optional[datetime]` - `error: Optional[StepUnionMember0AttemptError]` - `message: str` - `name: str` - `start: datetime` - `success: Optional[bool]` - `config: StepUnionMember0Config` - `retries: StepUnionMember0ConfigRetries` - `delay: Union[str, float]` Specifies the delay duration. '[dynamic]' indicates the delay is computed by a user-supplied function. - `str` - `float` - `limit: float` - `backoff: Optional[Literal["constant", "linear", "exponential"]]` - `"constant"` - `"linear"` - `"exponential"` - `timeout: Union[str, float]` Specifies the timeout duration. - `str` - `float` - `sensitive: Optional[Literal["output"]]` When set to 'output', step output is redacted from log and step output responses. - `"output"` - `end: Optional[datetime]` - `name: str` - `output: Optional[str]` - `start: datetime` - `success: Optional[bool]` - `type: Literal["step", "rollback"]` - `"step"` - `"rollback"` - `class StepUnionMember1: …` - `end: datetime` - `error: Optional[StepUnionMember1Error]` - `message: str` - `name: str` - `finished: bool` - `name: str` - `start: datetime` - `type: Literal["sleep"]` - `"sleep"` - `class StepUnionMember2: …` - `trigger: StepUnionMember2Trigger` - `source: str` - `type: Literal["termination"]` - `"termination"` - `class StepUnionMember3: …` - `end: datetime` - `error: Optional[StepUnionMember3Error]` - `message: str` - `name: str` - `finished: bool` - `name: str` - `start: datetime` - `type: Literal["waitForEvent"]` - `"waitForEvent"` - `output: Optional[str]` - `success: Optional[bool]` - `trigger: Trigger` - `source: Literal["unknown", "api", "binding", 2 more]` - `"unknown"` - `"api"` - `"binding"` - `"event"` - `"cron"` - `version_id: str` - `schedule: Optional[Schedule]` - `cron: str` - `scheduled_time: float` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) instance = client.workflows.instances.get( instance_id="x", account_id="account_id", workflow_name="x", ) print(instance.end) ``` #### Response ```json { "errors": [ { "code": 0, "message": "message" } ], "messages": [ { "code": 0, "message": "message" } ], "result": { "end": "2019-12-27T18:11:19.117Z", "error": { "message": "message", "name": "name" }, "output": "string", "params": {}, "queued": "2019-12-27T18:11:19.117Z", "rollback": { "error": { "message": "message", "name": "name" }, "outcome": "complete" }, "start": "2019-12-27T18:11:19.117Z", "status": "queued", "step_count": 0, "steps": [ { "attempts": [ { "end": "2019-12-27T18:11:19.117Z", "error": { "message": "message", "name": "name" }, "start": "2019-12-27T18:11:19.117Z", "success": true } ], "config": { "retries": { "delay": "string", "limit": 0, "backoff": "constant" }, "timeout": "string", "sensitive": "output" }, "end": "2019-12-27T18:11:19.117Z", "name": "name", "output": "output", "start": "2019-12-27T18:11:19.117Z", "success": true, "type": "step" } ], "success": true, "trigger": { "source": "unknown" }, "versionId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "schedule": { "cron": "cron", "scheduledTime": 0 } }, "success": true, "result_info": { "count": 0, "per_page": 0, "total_count": 0, "cursor": "cursor", "page": 0, "total_pages": 0 } } ``` ## Create a new workflow instance `workflows.instances.create(strworkflow_name, InstanceCreateParams**kwargs) -> InstanceCreateResponse` **post** `/accounts/{account_id}/workflows/{workflow_name}/instances` Creates a new instance of a workflow, starting its execution. ### Parameters - `account_id: str` - `workflow_name: str` - `instance_id: Optional[str]` - `instance_retention: Optional[InstanceRetention]` - `error_retention: Optional[Union[int, str]]` Specifies the duration in milliseconds or as a string like '5 minutes'. - `int` Specifies the duration in milliseconds. - `str` - `success_retention: Optional[Union[int, str]]` Specifies the duration in milliseconds or as a string like '5 minutes'. - `int` Specifies the duration in milliseconds. - `str` - `params: Optional[object]` ### Returns - `class InstanceCreateResponse: …` - `id: str` - `status: Literal["queued", "running", "paused", 6 more]` - `"queued"` - `"running"` - `"paused"` - `"errored"` - `"terminated"` - `"complete"` - `"waitingForPause"` - `"waiting"` - `"rollingBack"` - `version_id: str` - `workflow_id: str` - `trigger_source: Optional[Literal["unknown", "api", "binding", 2 more]]` - `"unknown"` - `"api"` - `"binding"` - `"event"` - `"cron"` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) instance = client.workflows.instances.create( workflow_name="x", account_id="account_id", ) print(instance.id) ``` #### Response ```json { "errors": [ { "code": 0, "message": "message" } ], "messages": [ { "code": 0, "message": "message" } ], "result": { "id": "x", "status": "queued", "version_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "workflow_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "trigger_source": "unknown" }, "success": true, "result_info": { "count": 0, "per_page": 0, "total_count": 0, "cursor": "cursor", "page": 0, "total_pages": 0 } } ``` ## Batch create new Workflow instances `workflows.instances.bulk(strworkflow_name, InstanceBulkParams**kwargs) -> SyncSinglePage[InstanceBulkResponse]` **post** `/accounts/{account_id}/workflows/{workflow_name}/instances/batch` Creates multiple workflow instances in a single batch operation. ### Parameters - `account_id: str` - `workflow_name: str` - `body: Optional[Iterable[Body]]` - `instance_id: Optional[str]` - `instance_retention: Optional[BodyInstanceRetention]` - `error_retention: Optional[Union[int, str]]` Specifies the duration in milliseconds or as a string like '5 minutes'. - `int` Specifies the duration in milliseconds. - `str` - `success_retention: Optional[Union[int, str]]` Specifies the duration in milliseconds or as a string like '5 minutes'. - `int` Specifies the duration in milliseconds. - `str` - `params: Optional[object]` ### Returns - `class InstanceBulkResponse: …` - `id: str` - `status: Literal["queued", "running", "paused", 6 more]` - `"queued"` - `"running"` - `"paused"` - `"errored"` - `"terminated"` - `"complete"` - `"waitingForPause"` - `"waiting"` - `"rollingBack"` - `version_id: str` - `workflow_id: str` - `trigger_source: Optional[Literal["unknown", "api", "binding", 2 more]]` - `"unknown"` - `"api"` - `"binding"` - `"event"` - `"cron"` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) page = client.workflows.instances.bulk( workflow_name="x", account_id="account_id", ) page = page.result[0] print(page.id) ``` #### Response ```json { "errors": [ { "code": 0, "message": "message" } ], "messages": [ { "code": 0, "message": "message" } ], "result": [ { "id": "x", "status": "queued", "version_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "workflow_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "trigger_source": "unknown" } ], "success": true, "result_info": { "count": 0, "per_page": 0, "total_count": 0, "cursor": "cursor", "page": 0, "total_pages": 0 } } ``` ## Get full step output from instance `workflows.instances.step(strinstance_id, InstanceStepParams**kwargs) -> InstanceStepResponse` **get** `/accounts/{account_id}/workflows/{workflow_name}/instances/{instance_id}/step` 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. ### Parameters - `account_id: str` - `workflow_name: str` - `instance_id: str` 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. - `name: str` Exact step name from the instance logs response, including the generated counter suffix. - `type: Literal["step", "waitForEvent"]` Step type to disambiguate step.do and waitForEvent entries that share the same name. - `"step"` - `"waitForEvent"` - `attempt: Optional[int]` Specific attempt number to retrieve output or error for. ### Returns - `class InstanceStepResponse: …` - `error: Optional[Error]` Error details when status='errored'; null otherwise. - `message: str` - `name: str` - `status: Literal["queued", "running", "paused", 6 more]` - `"queued"` - `"running"` - `"paused"` - `"errored"` - `"terminated"` - `"complete"` - `"waitingForPause"` - `"waiting"` - `"rollingBack"` - `output: Optional[object]` 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. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) response = client.workflows.instances.step( instance_id="x", account_id="account_id", workflow_name="x", name="x", type="step", ) print(response.error) ``` #### Response ```json { "errors": [ { "code": 0, "message": "message" } ], "messages": [ { "code": 0, "message": "message" } ], "result": { "error": { "message": "message", "name": "name" }, "status": "queued", "output": {} }, "success": true, "result_info": { "count": 0, "per_page": 0, "total_count": 0, "cursor": "cursor", "page": 0, "total_pages": 0 } } ``` ## Domain Types ### Instance List Response - `class InstanceListResponse: …` - `id: str` - `created_on: datetime` - `ended_on: Optional[datetime]` - `modified_on: datetime` - `started_on: Optional[datetime]` - `status: Literal["queued", "running", "paused", 6 more]` - `"queued"` - `"running"` - `"paused"` - `"errored"` - `"terminated"` - `"complete"` - `"waitingForPause"` - `"waiting"` - `"rollingBack"` - `version_id: str` - `workflow_id: str` - `trigger_source: Optional[Literal["unknown", "api", "binding", 2 more]]` - `"unknown"` - `"api"` - `"binding"` - `"event"` - `"cron"` ### Instance Get Response - `class InstanceGetResponse: …` - `end: Optional[datetime]` - `error: Optional[Error]` - `message: str` - `name: str` - `output: Union[str, float]` - `str` - `float` - `params: object` - `queued: datetime` - `rollback: Optional[Rollback]` - `error: Optional[RollbackError]` - `message: str` - `name: str` - `outcome: Literal["complete", "failed"]` - `"complete"` - `"failed"` - `start: Optional[datetime]` - `status: Literal["queued", "running", "paused", 6 more]` - `"queued"` - `"running"` - `"paused"` - `"errored"` - `"terminated"` - `"complete"` - `"waitingForPause"` - `"waiting"` - `"rollingBack"` - `step_count: int` - `steps: List[Step]` - `class StepUnionMember0: …` - `attempts: List[StepUnionMember0Attempt]` - `end: Optional[datetime]` - `error: Optional[StepUnionMember0AttemptError]` - `message: str` - `name: str` - `start: datetime` - `success: Optional[bool]` - `config: StepUnionMember0Config` - `retries: StepUnionMember0ConfigRetries` - `delay: Union[str, float]` Specifies the delay duration. '[dynamic]' indicates the delay is computed by a user-supplied function. - `str` - `float` - `limit: float` - `backoff: Optional[Literal["constant", "linear", "exponential"]]` - `"constant"` - `"linear"` - `"exponential"` - `timeout: Union[str, float]` Specifies the timeout duration. - `str` - `float` - `sensitive: Optional[Literal["output"]]` When set to 'output', step output is redacted from log and step output responses. - `"output"` - `end: Optional[datetime]` - `name: str` - `output: Optional[str]` - `start: datetime` - `success: Optional[bool]` - `type: Literal["step", "rollback"]` - `"step"` - `"rollback"` - `class StepUnionMember1: …` - `end: datetime` - `error: Optional[StepUnionMember1Error]` - `message: str` - `name: str` - `finished: bool` - `name: str` - `start: datetime` - `type: Literal["sleep"]` - `"sleep"` - `class StepUnionMember2: …` - `trigger: StepUnionMember2Trigger` - `source: str` - `type: Literal["termination"]` - `"termination"` - `class StepUnionMember3: …` - `end: datetime` - `error: Optional[StepUnionMember3Error]` - `message: str` - `name: str` - `finished: bool` - `name: str` - `start: datetime` - `type: Literal["waitForEvent"]` - `"waitForEvent"` - `output: Optional[str]` - `success: Optional[bool]` - `trigger: Trigger` - `source: Literal["unknown", "api", "binding", 2 more]` - `"unknown"` - `"api"` - `"binding"` - `"event"` - `"cron"` - `version_id: str` - `schedule: Optional[Schedule]` - `cron: str` - `scheduled_time: float` ### Instance Create Response - `class InstanceCreateResponse: …` - `id: str` - `status: Literal["queued", "running", "paused", 6 more]` - `"queued"` - `"running"` - `"paused"` - `"errored"` - `"terminated"` - `"complete"` - `"waitingForPause"` - `"waiting"` - `"rollingBack"` - `version_id: str` - `workflow_id: str` - `trigger_source: Optional[Literal["unknown", "api", "binding", 2 more]]` - `"unknown"` - `"api"` - `"binding"` - `"event"` - `"cron"` ### Instance Bulk Response - `class InstanceBulkResponse: …` - `id: str` - `status: Literal["queued", "running", "paused", 6 more]` - `"queued"` - `"running"` - `"paused"` - `"errored"` - `"terminated"` - `"complete"` - `"waitingForPause"` - `"waiting"` - `"rollingBack"` - `version_id: str` - `workflow_id: str` - `trigger_source: Optional[Literal["unknown", "api", "binding", 2 more]]` - `"unknown"` - `"api"` - `"binding"` - `"event"` - `"cron"` ### Instance Step Response - `class InstanceStepResponse: …` - `error: Optional[Error]` Error details when status='errored'; null otherwise. - `message: str` - `name: str` - `status: Literal["queued", "running", "paused", 6 more]` - `"queued"` - `"running"` - `"paused"` - `"errored"` - `"terminated"` - `"complete"` - `"waitingForPause"` - `"waiting"` - `"rollingBack"` - `output: Optional[object]` 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. # Status ## Change status of instance `workflows.instances.status.edit(strinstance_id, StatusEditParams**kwargs) -> StatusEditResponse` **patch** `/accounts/{account_id}/workflows/{workflow_name}/instances/{instance_id}/status` Changes the execution status of a workflow instance (e.g., pause, resume, terminate). ### Parameters - `account_id: str` - `workflow_name: str` - `instance_id: str` 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. - `status: Literal["pause"]` - `"pause"` ### Returns - `class StatusEditResponse: …` - `status: Literal["queued", "running", "paused", 6 more]` - `"queued"` - `"running"` - `"paused"` - `"errored"` - `"terminated"` - `"complete"` - `"waitingForPause"` - `"waiting"` - `"rollingBack"` - `timestamp: datetime` Accepts ISO 8601 with no timezone offsets and in UTC. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) response = client.workflows.instances.status.edit( instance_id="x", account_id="account_id", workflow_name="x", status="pause", ) print(response.status) ``` #### Response ```json { "errors": [ { "code": 0, "message": "message" } ], "messages": [ { "code": 0, "message": "message" } ], "result": { "status": "queued", "timestamp": "2019-12-27T18:11:19.117Z" }, "success": true, "result_info": { "count": 0, "per_page": 0, "total_count": 0, "cursor": "cursor", "page": 0, "total_pages": 0 } } ``` ## Domain Types ### Status Edit Response - `class StatusEditResponse: …` - `status: Literal["queued", "running", "paused", 6 more]` - `"queued"` - `"running"` - `"paused"` - `"errored"` - `"terminated"` - `"complete"` - `"waitingForPause"` - `"waiting"` - `"rollingBack"` - `timestamp: datetime` Accepts ISO 8601 with no timezone offsets and in UTC. # Events ## Send event to instance `workflows.instances.events.create(strevent_type, EventCreateParams**kwargs) -> object` **post** `/accounts/{account_id}/workflows/{workflow_name}/instances/{instance_id}/events/{event_type}` Sends an event to a running workflow instance to trigger state transitions. ### Parameters - `account_id: str` - `workflow_name: str` - `instance_id: str` 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. - `event_type: str` - `body: Optional[object]` ### Returns - `object` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) event = client.workflows.instances.events.create( event_type="x", account_id="account_id", workflow_name="x", instance_id="x", ) print(event) ``` #### Response ```json { "errors": [ { "code": 0, "message": "message" } ], "messages": [ { "code": 0, "message": "message" } ], "success": true, "result": {}, "result_info": { "count": 0, "per_page": 0, "total_count": 0, "cursor": "cursor", "page": 0, "total_pages": 0 } } ``` # Versions ## List deployed Workflow versions `workflows.versions.list(strworkflow_name, VersionListParams**kwargs) -> SyncV4PagePaginationArray[VersionListResponse]` **get** `/accounts/{account_id}/workflows/{workflow_name}/versions` Lists all deployed versions of a workflow. ### Parameters - `account_id: str` - `workflow_name: str` - `page: Optional[float]` - `per_page: Optional[float]` ### Returns - `class VersionListResponse: …` - `id: str` - `class_name: str` - `created_on: datetime` - `has_dag: bool` - `language: Literal["javascript", "python"]` The programming language of the workflow implementation - `"javascript"` - `"python"` - `modified_on: datetime` - `workflow_id: str` - `limits: Optional[Limits]` - `steps: Optional[int]` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) page = client.workflows.versions.list( workflow_name="x", account_id="account_id", ) page = page.result[0] print(page.id) ``` #### Response ```json { "errors": [ { "code": 0, "message": "message" } ], "messages": [ { "code": 0, "message": "message" } ], "result": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "class_name": "class_name", "created_on": "2019-12-27T18:11:19.117Z", "has_dag": true, "language": "javascript", "modified_on": "2019-12-27T18:11:19.117Z", "workflow_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "limits": { "steps": 1 } } ], "success": true, "result_info": { "count": 0, "per_page": 0, "total_count": 0, "cursor": "cursor", "page": 0, "total_pages": 0 } } ``` ## Get Workflow version details `workflows.versions.get(strversion_id, VersionGetParams**kwargs) -> VersionGetResponse` **get** `/accounts/{account_id}/workflows/{workflow_name}/versions/{version_id}` Retrieves details for a specific deployed workflow version. ### Parameters - `account_id: str` - `workflow_name: str` - `version_id: str` ### Returns - `class VersionGetResponse: …` - `id: str` - `class_name: str` - `created_on: datetime` - `has_dag: bool` - `language: Literal["javascript", "python"]` The programming language of the workflow implementation - `"javascript"` - `"python"` - `modified_on: datetime` - `workflow_id: str` - `limits: Optional[Limits]` - `steps: Optional[int]` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) version = client.workflows.versions.get( version_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", account_id="account_id", workflow_name="x", ) print(version.id) ``` #### Response ```json { "errors": [ { "code": 0, "message": "message" } ], "messages": [ { "code": 0, "message": "message" } ], "result": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "class_name": "class_name", "created_on": "2019-12-27T18:11:19.117Z", "has_dag": true, "language": "javascript", "modified_on": "2019-12-27T18:11:19.117Z", "workflow_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "limits": { "steps": 1 } }, "success": true, "result_info": { "count": 0, "per_page": 0, "total_count": 0, "cursor": "cursor", "page": 0, "total_pages": 0 } } ``` ## Get Workflow version graph `workflows.versions.graph(strversion_id, VersionGraphParams**kwargs) -> VersionGraphResponse` **get** `/accounts/{account_id}/workflows/{workflow_name}/versions/{version_id}/graph` Retrieves the graph visualization of a workflow version. ### Parameters - `account_id: str` - `workflow_name: str` - `version_id: str` ### Returns - `class VersionGraphResponse: …` - `id: str` - `class_name: str` - `created_on: datetime` - `graph: Optional[Graph]` Versioned workflow graph payload. - `version: float` - `workflow: GraphWorkflow` A parsed workflow entrypoint with its step graph. - `class_name: str` - `functions: Dict[str, GraphWorkflowFunctions]` - `name: str` - `nodes: List[object]` Child nodes (recursive). - `type: Literal["function_def"]` - `"function_def"` - `nodes: List[GraphWorkflowNode]` - `class GraphWorkflowNodeUnionMember0: …` - `duration: Union[float, str]` Duration as milliseconds (number) or human-readable string. - `float` - `str` - `name: str` - `type: Literal["step_sleep"]` - `"step_sleep"` - `resolves: Optional[float]` - `starts: Optional[float]` - `class GraphWorkflowNodeUnionMember1: …` - `config: GraphWorkflowNodeUnionMember1Config` Configuration for a step (retries and timeout). - `retries: GraphWorkflowNodeUnionMember1ConfigRetries` Retry policy for a step. - `backoff: Literal["constant", "linear", "exponential"]` Backoff strategy for step retries. - `"constant"` - `"linear"` - `"exponential"` - `delay: Union[float, str]` Duration as milliseconds (number) or human-readable string. - `float` - `str` - `limit: float` - `timeout: Union[float, str]` Duration as milliseconds (number) or human-readable string. - `float` - `str` - `name: str` - `nodes: List[object]` Child nodes (recursive). - `type: Literal["step_do"]` - `"step_do"` - `resolves: Optional[float]` - `starts: Optional[float]` - `class GraphWorkflowNodeUnionMember2: …` - `name: str` - `options: Optional[GraphWorkflowNodeUnionMember2Options]` Options for a waitForEvent step. - `event_type: str` - `timeout: Union[float, str]` Duration as milliseconds (number) or human-readable string. - `float` - `str` - `type: Literal["step_wait_for_event"]` - `"step_wait_for_event"` - `payload: Optional[GraphWorkflowNodeUnionMember2Payload]` Shape descriptor for JSON payloads. - `class GraphWorkflowNodeUnionMember2PayloadType: …` - `type: Literal["unknown"]` - `"unknown"` - `class GraphWorkflowNodeUnionMember2PayloadUnionMember1: …` - `fields: Dict[str, object]` Nested JsonShape fields (recursive structure). - `type: Literal["object"]` - `"object"` - `resolves: Optional[float]` - `starts: Optional[float]` - `class GraphWorkflowNodeUnionMember3: …` - `name: str` - `timestamp: str` - `type: Literal["step_sleep_until"]` - `"step_sleep_until"` - `resolves: Optional[float]` - `starts: Optional[float]` - `class GraphWorkflowNodeUnionMember4: …` - `nodes: List[object]` Child nodes (recursive). - `type: Literal["loop"]` - `"loop"` - `class GraphWorkflowNodeUnionMember5: …` - `kind: Literal["all", "any", "all_settled", "race"]` Parallel execution strategy. - `"all"` - `"any"` - `"all_settled"` - `"race"` - `nodes: List[object]` Child nodes (recursive). - `type: Literal["parallel"]` - `"parallel"` - `class GraphWorkflowNodeUnionMember6: …` - `catch_block: Optional[GraphWorkflowNodeUnionMember6CatchBlock]` - `nodes: List[object]` Child nodes (recursive). - `type: Literal["block"]` - `"block"` - `finally_block: Optional[GraphWorkflowNodeUnionMember6FinallyBlock]` - `nodes: List[object]` Child nodes (recursive). - `type: Literal["block"]` - `"block"` - `try_block: Optional[GraphWorkflowNodeUnionMember6TryBlock]` - `nodes: List[object]` Child nodes (recursive). - `type: Literal["block"]` - `"block"` - `type: Literal["try"]` - `"try"` - `class GraphWorkflowNodeUnionMember7: …` - `nodes: List[object]` Child nodes (recursive). - `type: Literal["block"]` - `"block"` - `class GraphWorkflowNodeUnionMember8: …` - `branches: List[GraphWorkflowNodeUnionMember8Branch]` - `condition: Optional[str]` - `nodes: List[object]` Child nodes (recursive). - `type: Literal["if"]` - `"if"` - `class GraphWorkflowNodeUnionMember9: …` - `branches: List[GraphWorkflowNodeUnionMember9Branch]` - `condition: Optional[str]` - `nodes: List[object]` Child nodes (recursive). - `discriminant: str` - `type: Literal["switch"]` - `"switch"` - `class GraphWorkflowNodeUnionMember10: …` - `class_name: str` - `functions: Dict[str, GraphWorkflowNodeUnionMember10Functions]` - `name: str` - `nodes: List[object]` Child nodes (recursive). - `type: Literal["function_def"]` - `"function_def"` - `nodes: List[object]` Child nodes (recursive). - `type: Literal["start"]` - `"start"` - `payload: Optional[GraphWorkflowNodeUnionMember10Payload]` Shape descriptor for JSON payloads. - `class GraphWorkflowNodeUnionMember10PayloadType: …` - `type: Literal["unknown"]` - `"unknown"` - `class GraphWorkflowNodeUnionMember10PayloadUnionMember1: …` - `fields: Dict[str, object]` Nested JsonShape fields (recursive structure). - `type: Literal["object"]` - `"object"` - `class GraphWorkflowNodeUnionMember11: …` - `name: str` - `type: Literal["function_call"]` - `"function_call"` - `resolves: Optional[float]` - `starts: Optional[float]` - `class GraphWorkflowNodeUnionMember12: …` - `name: str` - `nodes: List[object]` Child nodes (recursive). - `type: Literal["function_def"]` - `"function_def"` - `class GraphWorkflowNodeUnionMember13: …` - `kind: Literal["break", "return"]` Break or return from a loop. - `"break"` - `"return"` - `type: Literal["break"]` - `"break"` - `payload: Optional[GraphWorkflowPayload]` Shape descriptor for JSON payloads. - `class GraphWorkflowPayloadType: …` - `type: Literal["unknown"]` - `"unknown"` - `class GraphWorkflowPayloadUnionMember1: …` - `fields: Dict[str, object]` Nested JsonShape fields (recursive structure). - `type: Literal["object"]` - `"object"` - `modified_on: datetime` - `workflow_id: str` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) response = client.workflows.versions.graph( version_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", account_id="account_id", workflow_name="x", ) print(response.id) ``` #### Response ```json { "errors": [ { "code": 0, "message": "message" } ], "messages": [ { "code": 0, "message": "message" } ], "result": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "class_name": "class_name", "created_on": "2019-12-27T18:11:19.117Z", "graph": { "version": 0, "workflow": { "class_name": "class_name", "functions": { "foo": { "name": "name", "nodes": [ {} ], "type": "function_def" } }, "nodes": [ { "duration": 0, "name": "name", "type": "step_sleep", "resolves": 0, "starts": 0 } ], "payload": { "type": "unknown" } } }, "modified_on": "2019-12-27T18:11:19.117Z", "workflow_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" }, "success": true, "result_info": { "count": 0, "per_page": 0, "total_count": 0, "cursor": "cursor", "page": 0, "total_pages": 0 } } ``` ## Domain Types ### Version List Response - `class VersionListResponse: …` - `id: str` - `class_name: str` - `created_on: datetime` - `has_dag: bool` - `language: Literal["javascript", "python"]` The programming language of the workflow implementation - `"javascript"` - `"python"` - `modified_on: datetime` - `workflow_id: str` - `limits: Optional[Limits]` - `steps: Optional[int]` ### Version Get Response - `class VersionGetResponse: …` - `id: str` - `class_name: str` - `created_on: datetime` - `has_dag: bool` - `language: Literal["javascript", "python"]` The programming language of the workflow implementation - `"javascript"` - `"python"` - `modified_on: datetime` - `workflow_id: str` - `limits: Optional[Limits]` - `steps: Optional[int]` ### Version Graph Response - `class VersionGraphResponse: …` - `id: str` - `class_name: str` - `created_on: datetime` - `graph: Optional[Graph]` Versioned workflow graph payload. - `version: float` - `workflow: GraphWorkflow` A parsed workflow entrypoint with its step graph. - `class_name: str` - `functions: Dict[str, GraphWorkflowFunctions]` - `name: str` - `nodes: List[object]` Child nodes (recursive). - `type: Literal["function_def"]` - `"function_def"` - `nodes: List[GraphWorkflowNode]` - `class GraphWorkflowNodeUnionMember0: …` - `duration: Union[float, str]` Duration as milliseconds (number) or human-readable string. - `float` - `str` - `name: str` - `type: Literal["step_sleep"]` - `"step_sleep"` - `resolves: Optional[float]` - `starts: Optional[float]` - `class GraphWorkflowNodeUnionMember1: …` - `config: GraphWorkflowNodeUnionMember1Config` Configuration for a step (retries and timeout). - `retries: GraphWorkflowNodeUnionMember1ConfigRetries` Retry policy for a step. - `backoff: Literal["constant", "linear", "exponential"]` Backoff strategy for step retries. - `"constant"` - `"linear"` - `"exponential"` - `delay: Union[float, str]` Duration as milliseconds (number) or human-readable string. - `float` - `str` - `limit: float` - `timeout: Union[float, str]` Duration as milliseconds (number) or human-readable string. - `float` - `str` - `name: str` - `nodes: List[object]` Child nodes (recursive). - `type: Literal["step_do"]` - `"step_do"` - `resolves: Optional[float]` - `starts: Optional[float]` - `class GraphWorkflowNodeUnionMember2: …` - `name: str` - `options: Optional[GraphWorkflowNodeUnionMember2Options]` Options for a waitForEvent step. - `event_type: str` - `timeout: Union[float, str]` Duration as milliseconds (number) or human-readable string. - `float` - `str` - `type: Literal["step_wait_for_event"]` - `"step_wait_for_event"` - `payload: Optional[GraphWorkflowNodeUnionMember2Payload]` Shape descriptor for JSON payloads. - `class GraphWorkflowNodeUnionMember2PayloadType: …` - `type: Literal["unknown"]` - `"unknown"` - `class GraphWorkflowNodeUnionMember2PayloadUnionMember1: …` - `fields: Dict[str, object]` Nested JsonShape fields (recursive structure). - `type: Literal["object"]` - `"object"` - `resolves: Optional[float]` - `starts: Optional[float]` - `class GraphWorkflowNodeUnionMember3: …` - `name: str` - `timestamp: str` - `type: Literal["step_sleep_until"]` - `"step_sleep_until"` - `resolves: Optional[float]` - `starts: Optional[float]` - `class GraphWorkflowNodeUnionMember4: …` - `nodes: List[object]` Child nodes (recursive). - `type: Literal["loop"]` - `"loop"` - `class GraphWorkflowNodeUnionMember5: …` - `kind: Literal["all", "any", "all_settled", "race"]` Parallel execution strategy. - `"all"` - `"any"` - `"all_settled"` - `"race"` - `nodes: List[object]` Child nodes (recursive). - `type: Literal["parallel"]` - `"parallel"` - `class GraphWorkflowNodeUnionMember6: …` - `catch_block: Optional[GraphWorkflowNodeUnionMember6CatchBlock]` - `nodes: List[object]` Child nodes (recursive). - `type: Literal["block"]` - `"block"` - `finally_block: Optional[GraphWorkflowNodeUnionMember6FinallyBlock]` - `nodes: List[object]` Child nodes (recursive). - `type: Literal["block"]` - `"block"` - `try_block: Optional[GraphWorkflowNodeUnionMember6TryBlock]` - `nodes: List[object]` Child nodes (recursive). - `type: Literal["block"]` - `"block"` - `type: Literal["try"]` - `"try"` - `class GraphWorkflowNodeUnionMember7: …` - `nodes: List[object]` Child nodes (recursive). - `type: Literal["block"]` - `"block"` - `class GraphWorkflowNodeUnionMember8: …` - `branches: List[GraphWorkflowNodeUnionMember8Branch]` - `condition: Optional[str]` - `nodes: List[object]` Child nodes (recursive). - `type: Literal["if"]` - `"if"` - `class GraphWorkflowNodeUnionMember9: …` - `branches: List[GraphWorkflowNodeUnionMember9Branch]` - `condition: Optional[str]` - `nodes: List[object]` Child nodes (recursive). - `discriminant: str` - `type: Literal["switch"]` - `"switch"` - `class GraphWorkflowNodeUnionMember10: …` - `class_name: str` - `functions: Dict[str, GraphWorkflowNodeUnionMember10Functions]` - `name: str` - `nodes: List[object]` Child nodes (recursive). - `type: Literal["function_def"]` - `"function_def"` - `nodes: List[object]` Child nodes (recursive). - `type: Literal["start"]` - `"start"` - `payload: Optional[GraphWorkflowNodeUnionMember10Payload]` Shape descriptor for JSON payloads. - `class GraphWorkflowNodeUnionMember10PayloadType: …` - `type: Literal["unknown"]` - `"unknown"` - `class GraphWorkflowNodeUnionMember10PayloadUnionMember1: …` - `fields: Dict[str, object]` Nested JsonShape fields (recursive structure). - `type: Literal["object"]` - `"object"` - `class GraphWorkflowNodeUnionMember11: …` - `name: str` - `type: Literal["function_call"]` - `"function_call"` - `resolves: Optional[float]` - `starts: Optional[float]` - `class GraphWorkflowNodeUnionMember12: …` - `name: str` - `nodes: List[object]` Child nodes (recursive). - `type: Literal["function_def"]` - `"function_def"` - `class GraphWorkflowNodeUnionMember13: …` - `kind: Literal["break", "return"]` Break or return from a loop. - `"break"` - `"return"` - `type: Literal["break"]` - `"break"` - `payload: Optional[GraphWorkflowPayload]` Shape descriptor for JSON payloads. - `class GraphWorkflowPayloadType: …` - `type: Literal["unknown"]` - `"unknown"` - `class GraphWorkflowPayloadUnionMember1: …` - `fields: Dict[str, object]` Nested JsonShape fields (recursive structure). - `type: Literal["object"]` - `"object"` - `modified_on: datetime` - `workflow_id: str`