Clone Workflow
This endpoint allows you to create a new workflow by cloning from an existing workflow. If the workflow you are cloning from uses any databases, and you are cloning it to a different group than the original was in, any required databases will be recreated in the target group (database structure only – no data will be copied).
Database Cloning: When cloning workflows across groups, database structures are recreated but no data is copied. Only the database schema and field definitions are replicated.
POST Parameters
| Parameter | Required | Value | Description |
|---|---|---|---|
api_key | {key} | An API key that has access to the resource you want to query for | |
workflow_id | {integer} | The Workflow ID you wish to clone from | |
workflow_name | {unicode} | The name of the new workflow to be created | |
group_id | {integer} | The group where you want to place the new workflow (if left blank will be put in the root group of the API key) | |
input_account | {ASCII} | An optional field allowing the override of the default randomly generated email address (the prefix before the @ only) | |
db_links | {string} | Accepts either 1 to create new database structures and a workflow with links (default), or 0 to create a workflow without database-linked rules. |
Code Examples
The cURL, PHP, Python, Node.js, and C# examples call Xtracta from a trusted server. The React example calls an application-defined backend proxy so the API key is never exposed in browser code.
Store XTRACTA_API_KEY as a server-side environment variable. Never embed it in browser-delivered code.
curl --request POST 'https://api-app.xtracta.com/v1/workflow/clone' \ --header 'Accept: application/json' \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data-urlencode 'api_key=<API_KEY>' \ --data-urlencode 'workflow_id=<WORKFLOW_ID>' \ --data-urlencode 'workflow_name=Example_workflow' \ --data-urlencode 'input_account=example1'
Sample Request
POST https://api-app.xtracta.com/v1/workflow/clone HTTP/1.1 api_key=123&workflow_id=456789&workflow_name=Example_workflow&input_account=example1
Sample Response
<?xml version="1.0" encoding="UTF-8"?>
<workflow_response>
<status>200</status>
<message>The request has been successfully processed</message>
<workflow>
<workflow_id>123</workflow_id>
<workflow_name>Example Workflow</workflow_name>
<workflow_email>exampleuser@test.example.com</workflow_email>
<workflow_file_transfer>exampleuser:examplePass123@ftp.example.com</workflow_file_transfer>
<source_workflow_id>100</source_workflow_id>
</workflow>
<database/>
</workflow_response>
Schema Definition
Response Elements
| Element | Description |
|---|---|
<status> | A status code in response to the operation. |
<message> | Additional information about the operation – human readable. |
<workflow> | This element contains all of the further sub-elements with information about the workflow that has just been created. |
<workflow_id> | The unique ID of the workflow. |
<workflow_name> | The name of the workflow. |
<workflow_email> | The input email address that accepts documents for the workflow. |
<workflow_file_transfer> | The combined connection string used to access the file transfer server in the format username:password@server. |
<source_workflow_id> | The ID of the workflow from which this workflow was copied or cloned. |
<database> | Empty element indicating no database structure is returned in this response. |
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:complexType name="WorkflowType">
<xs:sequence>
<xs:element name="workflow_id" type="xs:positiveInteger"/>
<xs:element name="workflow_name" type="xs:string"/>
<xs:element name="workflow_email" type="xs:string" minOccurs="0"/>
<xs:element name="workflow_file_transfer" type="xs:string" minOccurs="0"/>
<xs:element name="source_workflow_id" type="xs:string" minOccurs="0" nillable="true"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ColumnType">
<xs:sequence>
<xs:element name="column_id" type="xs:positiveInteger"/>
<xs:element name="column_name" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="DatabaseType">
<xs:sequence>
<xs:element name="database_id" type="xs:positiveInteger" minOccurs="0"/>
<xs:element name="database_name" type="xs:string" minOccurs="0"/>
<xs:element name="column" type="ColumnType" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:element name="workflow_response">
<xs:complexType>
<xs:sequence>
<xs:element name="status" type="xs:positiveInteger"/>
<xs:element name="message" type="xs:string"/>
<xs:element name="workflow" type="WorkflowType" maxOccurs="unbounded" minOccurs="0"/>
<xs:element name="database" type="DatabaseType" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Error Responses
For JSON and XML responses generated by this endpoint, the response is wrapped in workflow_response and includes the HTTP status code and a message.
| Status | Message | Description |
|---|---|---|
400 | workflow_id is required / workflow_id must be natural number | Supply a positive integer source workflow ID. |
400 | Invalid parameter (workflow_id) is specified | The workflow does not exist or is a template rather than an active workflow. |
400 | workflow_name cannot exceed 255 characters | Shorten the cloned workflow name. |
400 | input_account cannot be below 1 characters | When supplied, input_account cannot be empty. |
400 | group_id must be natural number | Use a positive integer target group ID. |
400 | db_links must be '0' or '1' | Use 1 to clone linked databases or 0 not to. |
500 | Internal server error occurred. Please try again later or contact support@xtracta.com | Retry and contact support with the request parameters and timestamp if it persists. |
Authentication, permission, IP-access-control, and rate-limit failures can be returned before this endpoint processes the request. Confirm the API key and caller access first.