Starting a Workflow Run

This page will help you get started with Starting a Workflow Run.

Starting a Workflow Run

To start a workflow run, send a POST request to <https://api.copy.ai/api/workflow/><workflow_uuid>/run with a JSON body containing the starting value for the run. For example:

{
  "startVariables": {
        <input variables would go here>
    },
    "metadata": {
        <any meta data here>
    }
}

You will receive a response with the ID of the started workflow run:

{
  "status": "success",
  "data": {
    "id": "<workflow run id>"
  }
}

This ID can be used to track the progress of the workflow run and will also be included in the webhook request when the run is completed.

Tracking / Poll for Progress

To track a workflow run, send a GET request to <https://api.copy.ai/api/workflow/><workflow_uuid>/run/<workflow_run_id>. You will get a response in the following format:

{
    "status": "success",
    "data":
    {
        "id": "<workflow run id>",
        "input":
        { 
            ... 
        },
        "status": "PROCESSING",
        "output":
        {
            ...
        },
        "createdAt": "2022-11-18T20:30:07.434Z"
    }
}

When the run is complete, the status will change to COMPLETE.

Run Completion

When the run is completed, we also send a POST request to your webhook. Example request:

{
    "type": "workflowRun.completed",
    "workflowId": "<workflow id>",
    "workflowRunId": "<workflow run id>",
    "result": { "output": "<result of workflow>" },
        "metadata":
        {
            <any meta data here>
        },
}
Language
Click Try It! to start a request and see the response here!