# Workflows ## List all Workflows `client.workflows.list(WorkflowListParamsparams, RequestOptionsoptions?): V4PagePaginationArray` **get** `/accounts/{account_id}/workflows` Lists all workflows configured for the account. ### Parameters - `params: WorkflowListParams` - `account_id: string` Path param - `page?: number` Query param - `per_page?: number` Query param - `search?: string` Query param: Allows filtering workflows` name. ### Returns - `WorkflowListResponse` - `id: string` - `class_name: string` - `created_on: string` - `instances: Instances` - `complete?: number` - `errored?: number` - `paused?: number` - `queued?: number` - `running?: number` - `terminated?: number` - `waiting?: number` - `waitingForPause?: number` - `modified_on: string` - `name: string` - `script_name: string` - `triggered_on: string | null` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); // Automatically fetches more pages as needed. for await (const workflowListResponse of client.workflows.list({ account_id: 'account_id' })) { console.log(workflowListResponse.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, "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" } ], "success": true, "result_info": { "count": 0, "per_page": 0, "total_count": 0, "cursor": "cursor", "page": 0 } } ``` ## Get Workflow details `client.workflows.get(stringworkflowName, WorkflowGetParamsparams, RequestOptionsoptions?): WorkflowGetResponse` **get** `/accounts/{account_id}/workflows/{workflow_name}` Retrieves configuration and metadata for a specific workflow. ### Parameters - `workflowName: string` - `params: WorkflowGetParams` - `account_id: string` ### Returns - `WorkflowGetResponse` - `id: string` - `class_name: string` - `created_on: string` - `instances: Instances` - `complete?: number` - `errored?: number` - `paused?: number` - `queued?: number` - `running?: number` - `terminated?: number` - `waiting?: number` - `waitingForPause?: number` - `modified_on: string` - `name: string` - `script_name: string` - `triggered_on: string | null` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const workflow = await client.workflows.get('x', { account_id: 'account_id' }); console.log(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, "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" }, "success": true, "result_info": { "count": 0, "per_page": 0, "total_count": 0, "cursor": "cursor", "page": 0 } } ``` ## Create/modify Workflow `client.workflows.update(stringworkflowName, WorkflowUpdateParamsparams, RequestOptionsoptions?): WorkflowUpdateResponse` **put** `/accounts/{account_id}/workflows/{workflow_name}` Creates a new workflow or updates an existing workflow definition. ### Parameters - `workflowName: string` - `params: WorkflowUpdateParams` - `account_id: string` Path param - `class_name: string` Body param - `script_name: string` Body param - `limits?: Limits` Body param - `steps?: number` ### Returns - `WorkflowUpdateResponse` - `id: string` - `class_name: string` - `created_on: string` - `is_deleted: number` - `modified_on: string` - `name: string` - `script_name: string` - `terminator_running: number` - `triggered_on: string | null` - `version_id: string` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const workflow = await client.workflows.update('x', { account_id: 'account_id', class_name: 'x', script_name: 'x', }); console.log(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 } } ``` ## Deletes a Workflow `client.workflows.delete(stringworkflowName, WorkflowDeleteParamsparams, RequestOptionsoptions?): 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 - `workflowName: string` - `params: WorkflowDeleteParams` - `account_id: string` ### Returns - `WorkflowDeleteResponse` - `status: "ok"` - `"ok"` - `success: boolean | null` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const workflow = await client.workflows.delete('x', { account_id: 'account_id' }); console.log(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 } } ``` ## Domain Types ### Workflow List Response - `WorkflowListResponse` - `id: string` - `class_name: string` - `created_on: string` - `instances: Instances` - `complete?: number` - `errored?: number` - `paused?: number` - `queued?: number` - `running?: number` - `terminated?: number` - `waiting?: number` - `waitingForPause?: number` - `modified_on: string` - `name: string` - `script_name: string` - `triggered_on: string | null` ### Workflow Get Response - `WorkflowGetResponse` - `id: string` - `class_name: string` - `created_on: string` - `instances: Instances` - `complete?: number` - `errored?: number` - `paused?: number` - `queued?: number` - `running?: number` - `terminated?: number` - `waiting?: number` - `waitingForPause?: number` - `modified_on: string` - `name: string` - `script_name: string` - `triggered_on: string | null` ### Workflow Update Response - `WorkflowUpdateResponse` - `id: string` - `class_name: string` - `created_on: string` - `is_deleted: number` - `modified_on: string` - `name: string` - `script_name: string` - `terminator_running: number` - `triggered_on: string | null` - `version_id: string` ### Workflow Delete Response - `WorkflowDeleteResponse` - `status: "ok"` - `"ok"` - `success: boolean | null` # Instances ## List of workflow instances `client.workflows.instances.list(stringworkflowName, InstanceListParamsparams, RequestOptionsoptions?): V4PagePaginationArray` **get** `/accounts/{account_id}/workflows/{workflow_name}/instances` Lists all instances of a workflow with their execution status. ### Parameters - `workflowName: string` - `params: InstanceListParams` - `account_id: string` Path param - `cursor?: string` Query param: `page` and `cursor` are mutually exclusive, use one or the other. - `date_end?: string` Query param: Accepts ISO 8601 with no timezone offsets and in UTC. - `date_start?: string` Query param: Accepts ISO 8601 with no timezone offsets and in UTC. - `direction?: "asc" | "desc"` Query param: should only be used when `cursor` is used, defines a new direction for the cursor - `"asc"` - `"desc"` - `page?: number` Query param: `page` and `cursor` are mutually exclusive, use one or the other. - `per_page?: number` Query param - `status?: "queued" | "running" | "paused" | 5 more` Query param - `"queued"` - `"running"` - `"paused"` - `"errored"` - `"terminated"` - `"complete"` - `"waitingForPause"` - `"waiting"` ### Returns - `InstanceListResponse` - `id: string` - `created_on: string` - `ended_on: string | null` - `modified_on: string` - `started_on: string | null` - `status: "queued" | "running" | "paused" | 5 more` - `"queued"` - `"running"` - `"paused"` - `"errored"` - `"terminated"` - `"complete"` - `"waitingForPause"` - `"waiting"` - `version_id: string` - `workflow_id: string` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); // Automatically fetches more pages as needed. for await (const instanceListResponse of client.workflows.instances.list('x', { account_id: 'account_id', })) { console.log(instanceListResponse.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" } ], "success": true, "result_info": { "count": 0, "per_page": 0, "total_count": 0, "cursor": "cursor", "page": 0 } } ``` ## Get logs and status from instance `client.workflows.instances.get(stringworkflowName, stringinstanceId, InstanceGetParamsparams, RequestOptionsoptions?): InstanceGetResponse` **get** `/accounts/{account_id}/workflows/{workflow_name}/instances/{instance_id}` Retrieves logs and execution status for a specific workflow instance. ### Parameters - `workflowName: string` - `instanceId: string` - `params: InstanceGetParams` - `account_id: string` Path param - `order?: "asc" | "desc"` Query param: Step ordering: "asc" (default, oldest first) or "desc" (newest first). - `"asc"` - `"desc"` - `simple?: "true" | "false"` Query param: When true, omits step details and returns only metadata with step_count. - `"true"` - `"false"` ### Returns - `InstanceGetResponse` - `end: string | null` - `error: Error | null` - `message: string` - `name: string` - `output: string | number` - `string` - `number` - `params: unknown` - `queued: string` - `start: string | null` - `status: "queued" | "running" | "paused" | 5 more` - `"queued"` - `"running"` - `"paused"` - `"errored"` - `"terminated"` - `"complete"` - `"waitingForPause"` - `"waiting"` - `step_count: number` - `steps: Array` - `UnionMember0` - `attempts: Array` - `end: string | null` - `error: Error | null` - `message: string` - `name: string` - `start: string` - `success: boolean | null` - `config: Config` - `retries: Retries` - `delay: string | number` Specifies the delay duration. - `string` - `number` - `limit: number` - `backoff?: "constant" | "linear" | "exponential"` - `"constant"` - `"linear"` - `"exponential"` - `timeout: string | number` Specifies the timeout duration. - `string` - `number` - `end: string | null` - `name: string` - `output: string | null` - `start: string` - `success: boolean | null` - `type: "step"` - `"step"` - `UnionMember1` - `end: string` - `error: Error | null` - `message: string` - `name: string` - `finished: boolean` - `name: string` - `start: string` - `type: "sleep"` - `"sleep"` - `UnionMember2` - `trigger: Trigger` - `source: string` - `type: "termination"` - `"termination"` - `UnionMember3` - `end: string` - `error: Error | null` - `message: string` - `name: string` - `finished: boolean` - `name: string` - `start: string` - `type: "waitForEvent"` - `"waitForEvent"` - `output?: string` - `success: boolean | null` - `trigger: Trigger` - `source: "unknown" | "api" | "binding" | 2 more` - `"unknown"` - `"api"` - `"binding"` - `"event"` - `"cron"` - `versionId: string` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const instance = await client.workflows.instances.get('x', 'x', { account_id: 'account_id' }); console.log(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", "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" }, "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" }, "success": true, "result_info": { "count": 0, "per_page": 0, "total_count": 0, "cursor": "cursor", "page": 0 } } ``` ## Create a new workflow instance `client.workflows.instances.create(stringworkflowName, InstanceCreateParamsparams, RequestOptionsoptions?): InstanceCreateResponse` **post** `/accounts/{account_id}/workflows/{workflow_name}/instances` Creates a new instance of a workflow, starting its execution. ### Parameters - `workflowName: string` - `params: InstanceCreateParams` - `account_id: string` Path param - `instance_id?: string` Body param - `instance_retention?: InstanceRetention` Body param - `error_retention?: number | string` Specifies the duration in milliseconds or as a string like '5 minutes'. - `number` - `string` - `success_retention?: number | string` Specifies the duration in milliseconds or as a string like '5 minutes'. - `number` - `string` - `params?: unknown` Body param ### Returns - `InstanceCreateResponse` - `id: string` - `status: "queued" | "running" | "paused" | 5 more` - `"queued"` - `"running"` - `"paused"` - `"errored"` - `"terminated"` - `"complete"` - `"waitingForPause"` - `"waiting"` - `version_id: string` - `workflow_id: string` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const instance = await client.workflows.instances.create('x', { account_id: 'account_id' }); console.log(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" }, "success": true, "result_info": { "count": 0, "per_page": 0, "total_count": 0, "cursor": "cursor", "page": 0 } } ``` ## Batch create new Workflow instances `client.workflows.instances.bulk(stringworkflowName, InstanceBulkParamsparams, RequestOptionsoptions?): SinglePage` **post** `/accounts/{account_id}/workflows/{workflow_name}/instances/batch` Creates multiple workflow instances in a single batch operation. ### Parameters - `workflowName: string` - `params: InstanceBulkParams` - `account_id: string` Path param - `body?: Array` Body param - `instance_id?: string` - `instance_retention?: InstanceRetention` - `error_retention?: number | string` Specifies the duration in milliseconds or as a string like '5 minutes'. - `number` - `string` - `success_retention?: number | string` Specifies the duration in milliseconds or as a string like '5 minutes'. - `number` - `string` - `params?: unknown` ### Returns - `InstanceBulkResponse` - `id: string` - `status: "queued" | "running" | "paused" | 5 more` - `"queued"` - `"running"` - `"paused"` - `"errored"` - `"terminated"` - `"complete"` - `"waitingForPause"` - `"waiting"` - `version_id: string` - `workflow_id: string` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); // Automatically fetches more pages as needed. for await (const instanceBulkResponse of client.workflows.instances.bulk('x', { account_id: 'account_id', })) { console.log(instanceBulkResponse.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" } ], "success": true, "result_info": { "count": 0, "per_page": 0, "total_count": 0, "cursor": "cursor", "page": 0 } } ``` ## Domain Types ### Instance List Response - `InstanceListResponse` - `id: string` - `created_on: string` - `ended_on: string | null` - `modified_on: string` - `started_on: string | null` - `status: "queued" | "running" | "paused" | 5 more` - `"queued"` - `"running"` - `"paused"` - `"errored"` - `"terminated"` - `"complete"` - `"waitingForPause"` - `"waiting"` - `version_id: string` - `workflow_id: string` ### Instance Get Response - `InstanceGetResponse` - `end: string | null` - `error: Error | null` - `message: string` - `name: string` - `output: string | number` - `string` - `number` - `params: unknown` - `queued: string` - `start: string | null` - `status: "queued" | "running" | "paused" | 5 more` - `"queued"` - `"running"` - `"paused"` - `"errored"` - `"terminated"` - `"complete"` - `"waitingForPause"` - `"waiting"` - `step_count: number` - `steps: Array` - `UnionMember0` - `attempts: Array` - `end: string | null` - `error: Error | null` - `message: string` - `name: string` - `start: string` - `success: boolean | null` - `config: Config` - `retries: Retries` - `delay: string | number` Specifies the delay duration. - `string` - `number` - `limit: number` - `backoff?: "constant" | "linear" | "exponential"` - `"constant"` - `"linear"` - `"exponential"` - `timeout: string | number` Specifies the timeout duration. - `string` - `number` - `end: string | null` - `name: string` - `output: string | null` - `start: string` - `success: boolean | null` - `type: "step"` - `"step"` - `UnionMember1` - `end: string` - `error: Error | null` - `message: string` - `name: string` - `finished: boolean` - `name: string` - `start: string` - `type: "sleep"` - `"sleep"` - `UnionMember2` - `trigger: Trigger` - `source: string` - `type: "termination"` - `"termination"` - `UnionMember3` - `end: string` - `error: Error | null` - `message: string` - `name: string` - `finished: boolean` - `name: string` - `start: string` - `type: "waitForEvent"` - `"waitForEvent"` - `output?: string` - `success: boolean | null` - `trigger: Trigger` - `source: "unknown" | "api" | "binding" | 2 more` - `"unknown"` - `"api"` - `"binding"` - `"event"` - `"cron"` - `versionId: string` ### Instance Create Response - `InstanceCreateResponse` - `id: string` - `status: "queued" | "running" | "paused" | 5 more` - `"queued"` - `"running"` - `"paused"` - `"errored"` - `"terminated"` - `"complete"` - `"waitingForPause"` - `"waiting"` - `version_id: string` - `workflow_id: string` ### Instance Bulk Response - `InstanceBulkResponse` - `id: string` - `status: "queued" | "running" | "paused" | 5 more` - `"queued"` - `"running"` - `"paused"` - `"errored"` - `"terminated"` - `"complete"` - `"waitingForPause"` - `"waiting"` - `version_id: string` - `workflow_id: string` # Status ## Change status of instance `client.workflows.instances.status.edit(stringworkflowName, stringinstanceId, StatusEditParamsparams, RequestOptionsoptions?): 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 - `workflowName: string` - `instanceId: string` - `params: StatusEditParams` - `account_id: string` Path param - `status: "resume" | "pause" | "terminate" | "restart"` Body param: Apply action to instance. - `"resume"` - `"pause"` - `"terminate"` - `"restart"` ### Returns - `StatusEditResponse` - `status: "queued" | "running" | "paused" | 5 more` - `"queued"` - `"running"` - `"paused"` - `"errored"` - `"terminated"` - `"complete"` - `"waitingForPause"` - `"waiting"` - `timestamp: string` Accepts ISO 8601 with no timezone offsets and in UTC. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const response = await client.workflows.instances.status.edit('x', 'x', { account_id: 'account_id', status: 'resume', }); console.log(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 } } ``` ## Domain Types ### Status Edit Response - `StatusEditResponse` - `status: "queued" | "running" | "paused" | 5 more` - `"queued"` - `"running"` - `"paused"` - `"errored"` - `"terminated"` - `"complete"` - `"waitingForPause"` - `"waiting"` - `timestamp: string` Accepts ISO 8601 with no timezone offsets and in UTC. # Events ## Send event to instance `client.workflows.instances.events.create(stringworkflowName, stringinstanceId, stringeventType, EventCreateParamsparams, RequestOptionsoptions?): EventCreateResponse` **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 - `workflowName: string` - `instanceId: string` - `eventType: string` - `params: EventCreateParams` - `account_id: string` Path param - `body?: unknown` Body param ### Returns - `EventCreateResponse = unknown` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const event = await client.workflows.instances.events.create('x', 'x', 'x', { account_id: 'account_id', }); console.log(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 } } ``` ## Domain Types ### Event Create Response - `EventCreateResponse = unknown` # Versions ## List deployed Workflow versions `client.workflows.versions.list(stringworkflowName, VersionListParamsparams, RequestOptionsoptions?): V4PagePaginationArray` **get** `/accounts/{account_id}/workflows/{workflow_name}/versions` Lists all deployed versions of a workflow. ### Parameters - `workflowName: string` - `params: VersionListParams` - `account_id: string` Path param - `page?: number` Query param - `per_page?: number` Query param ### Returns - `VersionListResponse` - `id: string` - `class_name: string` - `created_on: string` - `has_dag: boolean` - `modified_on: string` - `workflow_id: string` - `limits?: Limits` - `steps?: number` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); // Automatically fetches more pages as needed. for await (const versionListResponse of client.workflows.versions.list('x', { account_id: 'account_id', })) { console.log(versionListResponse.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, "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 } } ``` ## Get Workflow version details `client.workflows.versions.get(stringworkflowName, stringversionId, VersionGetParamsparams, RequestOptionsoptions?): VersionGetResponse` **get** `/accounts/{account_id}/workflows/{workflow_name}/versions/{version_id}` Retrieves details for a specific deployed workflow version. ### Parameters - `workflowName: string` - `versionId: string` - `params: VersionGetParams` - `account_id: string` ### Returns - `VersionGetResponse` - `id: string` - `class_name: string` - `created_on: string` - `has_dag: boolean` - `modified_on: string` - `workflow_id: string` - `limits?: Limits` - `steps?: number` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const version = await client.workflows.versions.get('x', '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { account_id: 'account_id', }); console.log(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, "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 } } ``` ## Domain Types ### Version List Response - `VersionListResponse` - `id: string` - `class_name: string` - `created_on: string` - `has_dag: boolean` - `modified_on: string` - `workflow_id: string` - `limits?: Limits` - `steps?: number` ### Version Get Response - `VersionGetResponse` - `id: string` - `class_name: string` - `created_on: string` - `has_dag: boolean` - `modified_on: string` - `workflow_id: string` - `limits?: Limits` - `steps?: number`