Skip to main content
PATCH
/
api
/
v1
/
workflows
/
{workflowUniqueIdentifier}
Update a workflow
curl --request PATCH \
  --url https://workflow-app.thena.ai/api/v1/workflows/{workflowUniqueIdentifier} \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "annotations": [
    {
      "entityType": "Ticket",
      "requiredFields": {
        "ticketId": "{{context.event.message.payload.ticketId}}"
      },
      "relations": [
        "account",
        "account.classification"
      ],
      "pathToAnnotate": "context.event.message.payload.ticket"
    }
  ],
  "name": "<string>",
  "triggerEvent": "<string>",
  "filters": {
    "{{context.name}}": {
      "~starts": "T"
    }
  },
  "workflowDefinition": [
    {
      "activity": {
        "uniqueIdentifier": "<string>",
        "autoUpgradeToLatestVersion": true,
        "version": 123
      },
      "input": {},
      "retryPolicy": {
        "maximumAttempts": 123,
        "initialInterval": 123,
        "backoffCoefficient": 123
      },
      "stepIdentifier": 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

Path Parameters

workflowUniqueIdentifier
string
required

Body

application/json
annotations
string[]
required

The annotation for the workflow. It is used to pre-populate data from FK relations of the event data which can be used in filters and execution of the workflow.

Example:
[
{
"entityType": "Ticket",
"requiredFields": {
"ticketId": "{{context.event.message.payload.ticketId}}"
},
"relations": ["account", "account.classification"],
"pathToAnnotate": "context.event.message.payload.ticket"
}
]
name
string

The name of the workflow

triggerEvent
string

The event that triggers the workflow (Accepts event UID)

filters
object

Filters to applied on an event attribute to determine when the workflow should trigger. Supports:

Comparison Operators:
- ~eq: Exact match (any type)
- ~gte: Greater than or equal (numbers)
- ~lte: Less than or equal (numbers)
- ~in: Check if value is in array

String Operators:
- ~starts: String starts with
- ~ends: String ends with
- ~contains: String contains
- ~regex: Regular expression match

Logical Operators:
- ~and: All conditions must match
- ~or: Any condition must match

Example:
{ "{{context.name}}": { "~starts": "T" } }
Example:
{ "{{context.name}}": { "~starts": "T" } }
workflowDefinition
object[]

The definition of the workflow

executingAgent
string

The agent on behalf of which the workflow is executed

teamId
string

Provide team id if the visibility and execution of the workflow is to be team specific

metadata
object

The metadata for the workflow

Response

Operation successful

uid
string
required

The identifier for current version of the workflow

type
string
required

The type of the activity

subType
string
required

The sub type of the activity

uniqueIdentifier
string
required

The unique identifier of the workflow

name
string
required

The name identifier of the workflow

version
number
required

The version of the workflow

triggerEvent
object
required

The trigger event of the workflow

filters
object
required

The filters of the workflow

annotations
string[]
required

The annotation for the workflow

workflowDefinition
object[]
required

The workflow definition of the workflow

executingAgent
string
required

The executing agent of the workflow

isActive
boolean
required

The status of the workflow

createdAt
string<date-time>
required

The created at date of the workflow

updatedAt
string<date-time>
required

The updated at date of the workflow

createdBy
string
required

The created by of the workflow

teamId
string
required

The team id of the workflow

metadata
object
required

The metadata for the workflow