POST
/
api
/
v1
/
workflows
Create a new workflow
curl --request POST \
  --url https://workflow-app.thena.ai/api/v1/workflows \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '{
  "name": "<string>",
  "type": "MANUAL",
  "subType": "WORKFLOW",
  "triggerEvent": "<string>",
  "filters": {
    "{{context.name}}": {
      "~starts": "T"
    }
  },
  "annotations": [
    {
      "entityType": "Ticket",
      "requiredFields": {
        "ticketId": "{{context.event.message.payload.ticketId}}"
      },
      "relations": [
        "account",
        "account.classification"
      ],
      "pathToAnnotate": "context.event.message.payload.ticket"
    }
  ],
  "workflowDefinition": [
    {
      "stepIdentifier": 123,
      "activity": {
        "uniqueIdentifier": "<string>",
        "autoUpgradeToLatestVersion": true,
        "version": 123
      },
      "input": {},
      "retryPolicy": {
        "maximumAttempts": 123,
        "initialInterval": 123,
        "backoffCoefficient": 123
      },
      "onFailure": "ABORT",
      "executionTimeout": 123,
      "isSleepActivity": true,
      "dependencies": [
        "<string>"
      ],
      "requireApproval": true,
      "approver": {},
      "filters": {},
      "compensationActivity": {
        "activity": {
          "uniqueIdentifier": "<string>",
          "autoUpgradeToLatestVersion": true,
          "version": 123
        },
        "input": {}
      }
    }
  ],
  "executingAgent": "<string>",
  "teamId": "<string>",
  "metadata": {}
}'
{
  "uid": "<string>",
  "type": "<string>",
  "subType": "<string>",
  "uniqueIdentifier": "<string>",
  "name": "<string>",
  "version": 123,
  "triggerEvent": {
    "uid": "<string>",
    "description": "<string>",
    "eventName": "<string>",
    "source": "platform_app",
    "schema": {},
    "metadata": {}
  },
  "filters": {},
  "annotations": [
    "<string>"
  ],
  "workflowDefinition": [
    {
      "stepIdentifier": 123,
      "activity": {
        "name": "<string>",
        "uniqueIdentifier": "<string>",
        "version": 123,
        "autoUpgradeToLatestVersion": true
      },
      "input": {},
      "retryPolicy": {
        "maximumAttempts": 123,
        "initialInterval": 123,
        "backoffCoefficient": 123
      },
      "onFailure": "<string>",
      "isSleepActivity": true,
      "executionTimeout": 123,
      "approver": {
        "type": "TEAM",
        "uid": "<string>",
        "timeout": 123
      },
      "dependencies": [
        "<string>"
      ],
      "filters": {},
      "compensationActivity": {}
    }
  ],
  "executingAgent": "<string>",
  "isActive": true,
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z",
  "createdBy": "<string>",
  "teamId": "<string>",
  "metadata": {}
}

Authorizations

x-api-key
string
header
required

Enter your API key

Body

application/json

Response

201
application/json

Operation successful

The response is of type object.