Skip to content

Trigger workflow event

POST
/api/workflow/events
curl --request POST \
--url https://example.com/api/workflow/events \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "event": "start", "repositoryId": "my-repo", "packageName": "spring-2024-update", "workflowId": "content-approval", "targetStep": "legal-review", "comment": "Routing to legal for compliance review", "assignee": { "userName": "user@example.com", "displayName": "John Doe", "email": "user@example.com" }, "metadata": { "additionalProperty": "example" } }'

Triggers a workflow event (start, approve, reject, route, cancel, assign) for a package. The ‘assign’ event requires an ‘assignee’ UserRef in the request body and validates the user against the assignedGroups configured for the current workflow step.

Media typeapplication/json
object
event
required

The workflow event to trigger

string
Allowed values: start approve reject route cancel assign
Example
start
repositoryId
required

Repository CACHE_ROOT

string
Example
my-repo
packageName
required

Name of the package to associate with workflow

string
Example
spring-2024-update
workflowId

Workflow definition ID (required for ‘start’ event)

string
Example
content-approval
targetStep

Target step for ‘route’ event

string
Example
legal-review
comment

Optional comment for the event

string
Example
Routing to legal for compliance review
assignee
object
userName
required

User’s username/login

string
Example
user@example.com
displayName
required

User’s display name

string
Example
John Doe
email
required

User’s email address

string
Example
user@example.com
metadata

Additional metadata to pass to workflow engine

object
key
additional properties

Workflow event processed successfully

Media typeapplication/json
object
success
required

Whether the event was processed successfully

boolean
message

Status message

string
workflowInfo
object
workflowName
required

Name of the workflow definition

string
workflowInstanceId

External workflow engine instance ID

string
currentStep
required

Current step in the workflow

string
status

Current workflow status

string
default: active
Allowed values: active completed cancelled error
nextActionUrl

URL for the next action in external engine

string format: uri
startedAt
required

Unix timestamp when workflow started

number
completedAt

Unix timestamp when workflow completed

number
assignee
object
userName
required

User’s username/login

string
displayName
required

User’s display name

string
email
required

User’s email address

string
metadata

Additional metadata from external engine

object
key
additional properties
steps

Ordered list of workflow steps

Array<object>
default:
object
name
required

Step key

string
label
required

Display label

string
allowedActions

Actions allowed from this step

Array<string>
default:
Allowed values: start approve reject route cancel
assignedGroups

Security group IDs whose members can be assigned to this step

Array<string>
default:
history

History of workflow actions

Array<object>
default:
object
timestamp
required

Unix timestamp in milliseconds

number
action
required

The action that occurred

string
Allowed values: start approve reject route cancel assign status_update
fromStep

The step before this action (null for start)

string | null
toStep
required

The step after this action

string
user
object
userName
required

User’s username/login

string
displayName
required

User’s display name

string
email
required

User’s email address

string
comment

Optional comment for this action

string
externalReference

External system reference ID

string
error

Error message if the event failed

string
Example
{
"success": true,
"message": "Workflow started successfully",
"workflowInfo": {
"workflowName": "content-approval",
"workflowInstanceId": "wf-123",
"currentStep": "review",
"status": "active",
"nextActionUrl": "https://engine/api/tasks/123/complete",
"startedAt": 1706025600000,
"completedAt": 1706112000000,
"assignee": {
"userName": "user@example.com",
"displayName": "John Doe",
"email": "user@example.com"
},
"steps": [],
"history": []
},
"error": "Workflow engine unavailable"
}

Bad request - validation error or workflow error

Media typeapplication/json
object
success
required

Whether the event was processed successfully

boolean
message

Status message

string
workflowInfo
object
workflowName
required

Name of the workflow definition

string
workflowInstanceId

External workflow engine instance ID

string
currentStep
required

Current step in the workflow

string
status

Current workflow status

string
default: active
Allowed values: active completed cancelled error
nextActionUrl

URL for the next action in external engine

string format: uri
startedAt
required

Unix timestamp when workflow started

number
completedAt

Unix timestamp when workflow completed

number
assignee
object
userName
required

User’s username/login

string
displayName
required

User’s display name

string
email
required

User’s email address

string
metadata

Additional metadata from external engine

object
key
additional properties
steps

Ordered list of workflow steps

Array<object>
default:
object
name
required

Step key

string
label
required

Display label

string
allowedActions

Actions allowed from this step

Array<string>
default:
Allowed values: start approve reject route cancel
assignedGroups

Security group IDs whose members can be assigned to this step

Array<string>
default:
history

History of workflow actions

Array<object>
default:
object
timestamp
required

Unix timestamp in milliseconds

number
action
required

The action that occurred

string
Allowed values: start approve reject route cancel assign status_update
fromStep

The step before this action (null for start)

string | null
toStep
required

The step after this action

string
user
object
userName
required

User’s username/login

string
displayName
required

User’s display name

string
email
required

User’s email address

string
comment

Optional comment for this action

string
externalReference

External system reference ID

string
error

Error message if the event failed

string
Example
{
"success": true,
"message": "Workflow started successfully",
"workflowInfo": {
"workflowName": "content-approval",
"workflowInstanceId": "wf-123",
"currentStep": "review",
"status": "active",
"nextActionUrl": "https://engine/api/tasks/123/complete",
"startedAt": 1706025600000,
"completedAt": 1706112000000,
"assignee": {
"userName": "user@example.com",
"displayName": "John Doe",
"email": "user@example.com"
},
"steps": [],
"history": []
},
"error": "Workflow engine unavailable"
}

Internal server error

Media typeapplication/json
object
error
required

Indicates an error occurred

boolean
message
required

Error message describing what went wrong

string
Example
{
"error": true,
"message": "Item not found"
}