Trigger workflow event
const url = 'https://example.com/api/workflow/events';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"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"}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”object
The workflow event to trigger
Example
startRepository CACHE_ROOT
Example
my-repoName of the package to associate with workflow
Example
spring-2024-updateWorkflow definition ID (required for ‘start’ event)
Example
content-approvalTarget step for ‘route’ event
Example
legal-reviewOptional comment for the event
Example
Routing to legal for compliance reviewobject
User’s username/login
Example
user@example.comUser’s display name
Example
John DoeUser’s email address
Example
user@example.comAdditional metadata to pass to workflow engine
object
Responses
Section titled “Responses”Workflow event processed successfully
object
Whether the event was processed successfully
Status message
object
Name of the workflow definition
External workflow engine instance ID
Current step in the workflow
Current workflow status
URL for the next action in external engine
Unix timestamp when workflow started
Unix timestamp when workflow completed
object
User’s username/login
User’s display name
User’s email address
Additional metadata from external engine
object
Ordered list of workflow steps
object
Step key
Display label
Actions allowed from this step
Security group IDs whose members can be assigned to this step
History of workflow actions
object
Unix timestamp in milliseconds
The action that occurred
The step before this action (null for start)
The step after this action
object
User’s username/login
User’s display name
User’s email address
Optional comment for this action
External system reference ID
Error message if the event failed
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
object
Whether the event was processed successfully
Status message
object
Name of the workflow definition
External workflow engine instance ID
Current step in the workflow
Current workflow status
URL for the next action in external engine
Unix timestamp when workflow started
Unix timestamp when workflow completed
object
User’s username/login
User’s display name
User’s email address
Additional metadata from external engine
object
Ordered list of workflow steps
object
Step key
Display label
Actions allowed from this step
Security group IDs whose members can be assigned to this step
History of workflow actions
object
Unix timestamp in milliseconds
The action that occurred
The step before this action (null for start)
The step after this action
object
User’s username/login
User’s display name
User’s email address
Optional comment for this action
External system reference ID
Error message if the event failed
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
object
Indicates an error occurred
Error message describing what went wrong
Example
{ "error": true, "message": "Item not found"}