> This page is for Developers.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://zuora.ferndocs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://zuora.ferndocs.com/_mcp/server.

# Export a workflow version

GET https://rest.test.zuora.com/workflows/{workflow_id}/export


Exports a workflow version into a JSON file. This file can be used to create a copy of this workflow version.

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


Reference: https://zuora.ferndocs.com/developers/api-reference/zuora-api/workflow/workflows/get-workflow-export

## Authentication

- `Authorization` header (bearer token, required) — Use `Bearer {{token}}` in the `Authorization` header for authentication.

## Servers

- `https://rest.test.zuora.com` (US Developer & Central Sandbox (incl. Test Drive), default)
- `https://rest.sandbox.na.zuora.com` (US API Sandbox Cloud 1)
- `https://rest.apisandbox.zuora.com` (US API Sandbox Cloud 2)
- `https://rest.na.zuora.com` (US Production Cloud 1)
- `https://rest.zuora.com` (US Production Cloud 2)
- `https://rest.test.eu.zuora.com` (EU Developer & Central Sandbox)
- `https://rest.sandbox.eu.zuora.com` (EU API Sandbox)
- `https://rest.eu.zuora.com` (EU Production)
- `https://rest.test.ap.zuora.com` (APAC Developer & Central Sandbox)
- `https://rest.ap.zuora.com` (APAC Production)

## Request

### Path parameters

- `workflow_id` (integer, required) — The ID of the workflow definition to export.

### Query parameters

- `version` (string, optional) — Default result is the active version of the workflow definition. Version number and 'latest' can be used to export a specific version of the workflow definition.

### Headers

- `Accept-Encoding` (string, optional) — Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it.
- `Content-Encoding` (string, optional) — Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload.
- `Zuora-Track-Id` (string, optional) — A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`"`), and quote (`'`).

## Response

### 200

OK

- `linkages` (list of Linkage, optional)
- `tasks` (list of Task, optional)
- `workflow` (Workflow, optional) — A workflow.

## Errors

### 400 Bad Request Error

The input of version is invalid.

- `errors` (list of WorkflowError, optional) — The list of errors returned from the workflow

### 404 Not Found Error

Workflow version is not found.

- `errors` (list of WorkflowError, optional) — The list of errors returned from the workflow

## Types

### Linkage

Used to represent the relationship between workflow tasks

- `linkage_type` (enum, optional)
  - Allowed values: `Start`, `Success`, `Failure`, `Iterate`, `True`, `False`, `Approve`, `Reject`
- `source_task_id` (integer, optional) — the task that spawned the target task
- `source_workflow_id` (integer, optional) — the workflow the target task is associated with
- `target_task_id` (integer, optional) — the task that the source task is linked to.

### Task

A task.

- `action_type` (enum, optional) — The type of the task.
  - Allowed values: `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`
- `call_type` (string, optional) — The type of API used.
- `concurrent_limit` (integer, optional) — the number of concurrent tasks that are allowed to run simultaneously
- `data` (TaskData, optional) — The data payload for the task.
- `end_time` (string, optional) — If **Instance** is **true**, the end time of the task instance.
- `error` (string, optional) — If **Instance** is **true** and **status** is **Error**, the error reason of the task instance failure.
- `error_class` (string, optional) — If **Instance** is **true** and **status** is **Error**, the error class of the task instance failure.
- `error_details` (string, optional) — If **Instance** is **true** and **status** is **Error**, the error details of the task instance failure.
- `id` (integer, optional) — The unique ID of the task.
- `instance` (boolean, optional) — Indicates whether this task belongs to an instance of a workflow.
- `name` (string, optional) — The name of the task.
- `object` (string, optional) — The selected object for the task.
- `object_id` (string, optional) — The id of the selected object of the task.
- `original_task_id` (integer, optional) — If **Instance** is **true**, the ID of the original task in the original workflow.
- `original_workflow_id` (integer, optional) — If **Instance** is **true**, the ID of the original workflow.
- `parameters` (TaskParameters, optional) — The configuration of the task.
- `start_time` (string, optional) — If **Instance** is **true**, the start time of the task instance.
- `status` (enum, optional) — If **Instance** is **true**, the status of the task instance.
  - Allowed values: `Queued`, `Processing`, `Pending`, `Success`, `Stopped`, `Error`
- `tags` (list of string, optional) — The array of filter tags.
- `task_id` (integer, optional) — the id of this task's parent task. Will be null if this is the first task of the workflow
- `workflow_id` (integer, optional) — The ID of the workflow that the task belongs to.

### Workflow

A workflow.

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

### WorkflowError

- `code` (enum, optional) — A short error code describing the error
  - Allowed values: `invalid`
- `status` (integer, optional) — The http status code for this error
- `title` (string, optional) — A human readable description describing the error

### TaskData

The data payload for the task.

### TaskParameters

The configuration of the task.

## Examples

**Response**

```json
{
  "linkages": [
    {
      "linkage_type": "Start",
      "source_workflow_id": 286,
      "target_task_id": 849
    }
  ],
  "tasks": [
    {
      "action_type": "Callout",
      "call_type": "SOAP",
      "concurrent_limit": 9999999,
      "id": 849,
      "name": "Call Echo",
      "parameters": {
        "authorization": {
          "type": "none"
        },
        "body_type": "raw",
        "datas": [
          {
            "key": "",
            "value": ""
          }
        ],
        "headers": [
          {
            "key": "",
            "value": ""
          }
        ],
        "include_response_code": "true",
        "method": "GET",
        "raw_body": "",
        "retry_rules": {
          "current_retry_count": "0",
          "retry_count": "0",
          "retry_window": "30"
        },
        "strict_variables": "true",
        "url": "http://scooterlabs.com/echo",
        "validate_response": "false",
        "validation": {
          "status_codes": [
            "",
            "200"
          ],
          "zuora_call": "false"
        },
        "validation_scheme": ""
      },
      "tags": [
        ""
      ],
      "assignment": [],
      "css": {
        "left": "470px",
        "top": "160px"
      },
      "iterate_row_reference": null,
      "object_batched_reference": null,
      "priority": "Medium",
      "process_id": null
    }
  ],
  "workflow": {
    "description": "",
    "id": 286,
    "name": "Call Echo",
    "type": "Workflow::Setup",
    "version": "0.0.1",
    "call_type": null,
    "callout_trigger": true,
    "css": {
      "left": "30px",
      "top": "40px"
    },
    "data": {},
    "delete_ttl": 60,
    "finished_at": null,
    "notifications": {},
    "ondemand_trigger": true,
    "original_workflow_id": null,
    "parameters": {},
    "priority": "Medium",
    "scheduled_trigger": false,
    "started_at": null,
    "status": null,
    "sync_trigger": false,
    "task_summary": {}
  }
}
```

**SDK Code**

```python response
import requests

url = "https://rest.test.zuora.com/workflows/1/export"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript response
const url = 'https://rest.test.zuora.com/workflows/1/export';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go response
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://rest.test.zuora.com/workflows/1/export"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby response
require 'uri'
require 'net/http'

url = URI("https://rest.test.zuora.com/workflows/1/export")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java response
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://rest.test.zuora.com/workflows/1/export")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php response
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://rest.test.zuora.com/workflows/1/export', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp response
using RestSharp;

var client = new RestClient("https://rest.test.zuora.com/workflows/1/export");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift response
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://rest.test.zuora.com/workflows/1/export")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```