---
title: "Import a workflow version"
method: POST
path: "/workflows/{workflow_id}/versions/import"
tags: ["Workflows"]
---

# Import a workflow version

`POST /workflows/{workflow_id}/versions/import`

Create a new workflow version under a workflow definition using the exported JSON document of an existing workflow version.

### User Access Permission
You must be assigned the **Workflow Manage Access** permission to run this operation.

## Path parameters

- `workflow_id` integer, required

## Query parameters

- `version` string, required
- `activate` boolean

## Headers

- `Idempotency-Key` string
- `Accept-Encoding` string
- `Content-Encoding` string
- `Zuora-Track-Id` string

## Request body

- object
  - `linkages` Linkage[]
    - `linkage_type` 'Start' | 'Success' | 'Failure' | 'Iterate' | 'True' | 'False' | 'Approve' | 'Reject'
    - `source_task_id` integer, nullable — the task that spawned the target task
    - `source_workflow_id` integer — the workflow the target task is associated with
    - `target_task_id` integer — the task that the source task is linked to.
  - `tasks` Task[]
    - `action_type` 'Approval' | 'Attachment' | 'Billing::BillRun' | 'Billing::CurrencyConversion' | 'Billing::CustomInvoice' | 'Callout' | 'Cancel' | 'Create' | 'CustomObject::Create' | 'CustomObject::Delete' | 'CustomObject::Query' | 'CustomObject::Update' | 'Data::BillingPreviewRun' | 'Data::Link' | 'Delay' | 'Delete' | 'Download::SFTP' | 'Email' | 'Export' | 'File::CustomPDF::CustomDocument' | 'If' | 'InvoiceGenerate' | 'Iterate' | 'Logic::CSVTranslator' | 'Logic::Case' | 'Logic::CustomCode' | 'Logic::JSONTransform' | 'Logic::Lambda' | 'Logic::ResponseFormatter' | 'Logic::XMLTransform' | 'NewProduct' | 'Notifications::GoogleCloudPrint' | 'Notifications::PhoneCall' | 'Notifications::SMS' | 'Payment::GatewayReconciliation' | 'Payment::PaymentRun' | 'Query' | 'RemoveProduct' | 'Reporting::ReportData' | 'Reporting::RunReport' | 'Resume' | 'Suspend' | 'UI::Page' | 'UI::Stop' | 'Update' | 'Upload::FTP' | 'Upload::SFTP' | 'WriteOff' — The type of the task.
    - `call_type` string — The type of API used.
    - `concurrent_limit` integer — the number of concurrent tasks that are allowed to run simultaneously
    - `data` object — The data payload for the task.
    - `end_time` string — If **Instance** is **true**, the end time of the task instance.
    - `error` string, nullable — If **Instance** is **true** and **status** is **Error**, the error reason of the task instance failure.
    - `error_class` string, nullable — If **Instance** is **true** and **status** is **Error**, the error class of the task instance failure.
    - `error_details` string, nullable — If **Instance** is **true** and **status** is **Error**, the error details of the task instance failure.
    - `id` integer — The unique ID of the task.
    - `instance` boolean — Indicates whether this task belongs to an instance of a workflow.
    - `name` string — The name of the task.
    - `object` string, nullable — The selected object for the task.
    - `object_id` string, nullable — The id of the selected object of the task.
    - `original_task_id` integer, nullable — If **Instance** is **true**, the ID of the original task in the original workflow.
    - `original_workflow_id` integer, nullable — If **Instance** is **true**, the ID of the original workflow.
    - `parameters` object — The configuration of the task.
    - `start_time` string — If **Instance** is **true**, the start time of the task instance.
    - `status` 'Queued' | 'Processing' | 'Pending' | 'Success' | 'Stopped' | 'Error', nullable — If **Instance** is **true**, the status of the task instance.
    - `tags` string[] — The array of filter tags.
    - `task_id` integer, nullable — the id of this task's parent task. Will be null if this is the first task of the workflow
    - `workflow_id` integer — The ID of the workflow that the task belongs to.
  - `workflow` DetailedWorkflow — A workflow.
    - `call_type` string — The call type of the active workflow version.
    - `calloutTrigger` boolean — Indicates whether the callout trigger is enabled for the retrieved workflow.
    - `createdAt` string, datetime — The date and time when the workflow is created, in the `YYYY-MM-DD HH:MM:SS` format.
    - `description` string — The description of the workflow.
    - `finished_at` string, datetime — The date and time when the instance of the workflow version finished at.
    - `id` integer — The unique ID of the workflow.
    - `interval` string — The schedule of the workflow, in a CRON expression. Returns null if the schedued trigger is disabled.
    - `name` string — The name of the workflow.
    - `ondemandTrigger` boolean — Indicates whether the ondemand trigger is enabled for the workflow.
    - `original_workflow_id` integer — The unique ID of the original workflow version.
    - `priority` string — The priority of the active workflow version.
    - `scheduledTrigger` boolean — Indicates whether the scheduled trigger is enabled for the workflow.
    - `started_at` string, datetime — The date and time when the instance of the workflow version started at.
    - `status` integer — The status of the active workflow version.
    - `sync_trigger` boolean — Indicates whether the workflow version is enabled for the sync mode.
    - `timezone` string — The timezone that is configured for the scheduler of the workflow. Returns null if the scheduled trigger is disabled.
    - `type` 'Workflow::Setup' | 'Workflow::Instance' — The type of the workflow. Currently the only valid value is 'Workflow::Setup'.
    - `updatedAt` string, datetime — The date and time when the workflow is updated the last time, in the `YYYY-MM-DD HH:MM:SS` format.
    - `version` string — The version number of the active workflow version.

## Response `200`

OK

- WorkflowDefinition — A workflow.
  - `active_version` object — Information of the active version.
    - `description` string — The description of the active version.
    - `id` integer — The unique ID of the active version.
    - `status` string — The status of the active version.
    - `type` 'Workflow::Setup' | 'Workflow::Instance' — The type of the active version. Currently the only valid value is 'Workflow::Setup'.
    - `version` string — The version number of the active version.
  - `calloutTrigger` boolean — Indicates whether the callout trigger is enabled for the retrieved workflow.
  - `createdAt` string, datetime — The date and time when the workflow is created, in the `YYYY-MM-DD HH:MM:SS` format.
  - `description` string — The description of the workflow definition.
  - `id` integer — The unique ID of the workflow definition.
  - `interval` string, nullable — The schedule of the workflow, in a CRON expression. Returns null if the schedued trigger is disabled.
  - `name` string — The name of the workflow definition.
  - `ondemandTrigger` boolean — Indicates whether the ondemand trigger is enabled for the workflow.
  - `scheduledTrigger` boolean — Indicates whether the scheduled trigger is enabled for the workflow.
  - `status` string — The status of the workflow definition.
  - `timezone` string, nullable — The timezone that is configured for the scheduler of the workflow. Returns null if the scheduled trigger is disabled.
  - `updatedAt` string, datetime — The date and time when the workflow is updated the last time, in the `YYYY-MM-DD HH:MM:SS` format.

---

[API](https://skmtc.dev/zuora/apis/api-reference.md) · [All operations](https://skmtc.dev/zuora/apis/api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/zuora/api-reference/revisions/d11e237f3e54/schema)
