Start a workflow

To start a workflow, you must register with SimWorkflow and have a valid Personal Access Token to authenticate requests. Anonymous requests are never allowed to start workflows.

Request syntax

POST /workflows HTTP/1.1
Host: api.simworkflow.com
Authorization: Bearer ${PERSONAL_ACCESS_TOKEN}
Content-Type: application/json
{
  "workflowDefinitionId": WorkflowDefinitionId,
  "workflowDefinitionVersion": Integer,
  "input": JSON
}

Request headers

Authorization

Bearer ${PERSONAL_ACCESS_TOKEN}

Content-Type

application/json

Request body

The request body accepts the following data in JSON format.

Field

Type

Required

Description

workflowDefinitionId

Workflow Definition Id

Yes

The Id of the workflow definition.

workflowDefinitionVersion

Integer

No

The version number of the workflow definition. The latest workflow definition will be used if no version specified.

input

JSON Object

No

JSON object with key value params, that can be used by downstream tasks.

Response syntax

HTTP/1.1 200 OK
String

Response elements

If the action is successful, the service sends back an HTTP 200 response.

The response returns the body contains the Id for the started workflow as String.

Errors

See also general errors.

cURL example: start a workflow

GET /workflow-definitions

curl \
--request "POST" \
--header "Authorization: Bearer ${PERSONAL_ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--url "https://api.simworkflow.com/workflows" \
--data '{
  "workflowDefinitionId": "7RXzkCER4ERYGpMzvrfy1D"
}'

RESPONSE

HTTP/1.1 200 OK
"1fD41T1coEVALQtpSIfWq3"