Skip to main content

Workflows API

The Workflows API provides full CRUD operations for workflows, workflow steps, credentials, and access to execution history and health metrics. All endpoints are scoped to the authenticated user's department and require Department Admin permissions.

Base URL: /api/v4/workflows

Authentication

All Workflows API endpoints require a valid JWT token. See API Authentication for details.

Workflows

List Workflows

Returns all workflows for the authenticated user's department.

GET /api/v4/workflows

Response: Array of WorkflowResult objects.

Get Workflow

Returns a specific workflow by ID, including its steps.

GET /api/v4/workflows/{id}
ParameterTypeDescription
idintWorkflow ID

Response: WorkflowResult object with steps.

Create Workflow

Creates a new workflow.

POST /api/v4/workflows

Request Body: WorkflowInput

FieldTypeRequiredDescription
NamestringYesWorkflow name (max 250 characters)
DescriptionstringNoDescription (max 1000 characters)
TriggerEventTypeintYesEvent type enum value (see Event Types)
IsEnabledboolNoEnabled state (default: true)
MaxRetryCountintNoMax retry attempts (default: 3, maximum: 5)
RetryBackoffBaseSecondsintNoBackoff base in seconds (default: 5)

Response: Created WorkflowResult object.

Plan-Based Limits

The number of workflows per department is capped by subscription plan (3 for free, 28 for paid). If you exceed the limit, the API returns 400 Bad Request with a descriptive error message. The MaxRetryCount field is capped at a server-side ceiling of 5 regardless of the value provided.

Update Workflow

Updates an existing workflow.

PUT /api/v4/workflows/{id}
ParameterTypeDescription
idintWorkflow ID

Request Body: WorkflowInput (same as create).

Response: Updated WorkflowResult object.

Delete Workflow

Deletes a workflow and all its steps.

DELETE /api/v4/workflows/{id}
ParameterTypeDescription
idintWorkflow ID

Response: 200 OK on success.

Workflow Steps

Add Step

Adds a step to a workflow.

POST /api/v4/workflows/{id}/steps
ParameterTypeDescription
idintWorkflow ID

Request Body: WorkflowStepInput

FieldTypeRequiredDescription
ActionTypeintYesAction type enum value (see Action Types)
StepOrderintYesExecution order
OutputTemplatestringYesScriban template text (max 64 KB)
ActionConfigstringNoJSON action-specific settings
WorkflowCredentialIdintNoCredential ID to use
IsEnabledboolNoEnabled state (default: true)

Response: Created WorkflowStepResult object.

Plan-Based Step Limits

The number of steps per workflow is capped by subscription plan (5 for free, 20 for paid). If you exceed the limit, the API returns 400 Bad Request with a descriptive error message.

Update Step

Updates an existing workflow step.

PUT /api/v4/workflows/{id}/steps/{stepId}
ParameterTypeDescription
idintWorkflow ID
stepIdintStep ID

Request Body: WorkflowStepInput (same as add).

Response: Updated WorkflowStepResult object.

Delete Step

Deletes a workflow step.

DELETE /api/v4/workflows/{id}/steps/{stepId}

Response: 200 OK on success.

Workflow Credentials

List Credentials

Returns all credentials for the department. Secret values are masked.

GET /api/v4/workflows/credentials

Response: Array of WorkflowCredentialResult objects (secrets shown as ••••••).

Get Credential

Returns a specific credential by ID. Secret values are masked.

GET /api/v4/workflows/credentials/{id}

Response: WorkflowCredentialResult object.

Create Credential

Creates a new credential. Accepts plaintext secret values which are encrypted before storage.

POST /api/v4/workflows/credentials

Request Body: WorkflowCredentialInput

FieldTypeRequiredDescription
NamestringYesFriendly name (max 250 characters)
CredentialTypeintYesCredential type enum value (see Credential Types)
DataobjectYesPlaintext credential data (type-specific fields)

Response: Created WorkflowCredentialResult object (secrets masked).

Plan-Based Credential Limits

The number of stored credentials per department is capped by subscription plan (2 for free, 20 for paid). If you exceed the limit, the API returns 400 Bad Request.

Write-Only Secrets

Credential secret values are encrypted at rest and never returned in API responses. You can only set them when creating or updating a credential.

Update Credential

Updates an existing credential. Existing secrets are preserved unless new values are provided.

PUT /api/v4/workflows/credentials/{id}

Response: Updated WorkflowCredentialResult object.

Delete Credential

Deletes a credential. Workflows referencing this credential will fail on next execution.

DELETE /api/v4/workflows/credentials/{id}

Response: 200 OK on success.

Workflow Testing

Test Workflow

Manually triggers a workflow with a sample event payload for testing purposes.

POST /api/v4/workflows/{id}/test

Request Body: WorkflowTestInput

FieldTypeRequiredDescription
EventPayloadJsonstringNoCustom JSON payload (uses sample data if omitted)

Response: WorkflowRunResult object with execution details.

Workflow Runs

List Runs by Workflow

Returns paginated runs for a specific workflow.

GET /api/v4/workflows/{id}/runs?page={page}&pageSize={pageSize}
ParameterTypeDefaultDescription
idintWorkflow ID
pageint1Page number
pageSizeint20Results per page

Response: Array of WorkflowRunResult objects.

List All Runs

Returns paginated runs for the entire department.

GET /api/v4/workflows/runs?page={page}&pageSize={pageSize}

Response: Array of WorkflowRunResult objects.

List Pending Runs

Returns all pending and in-progress runs for the department.

GET /api/v4/workflows/runs/pending

Response: Array of WorkflowRunResult objects.

Get Run Logs

Returns detailed step-by-step logs for a specific run.

GET /api/v4/workflows/runs/{runId}/logs
ParameterTypeDescription
runIdlongWorkflow Run ID

Response: Array of WorkflowRunLogResult objects.

FieldTypeDescription
WorkflowRunLogIdlongLog entry ID
WorkflowStepIdintStep that was executed
StatusintStep execution status
RenderedOutputstringThe Scriban-rendered content
ActionResultstringHTTP status, SMTP response, etc.
ErrorMessagestringError details (if failed)
StartedOndatetimeStep start time
CompletedOndatetimeStep completion time
DurationMslongStep execution time in milliseconds

Cancel Run

Cancels a pending workflow run.

POST /api/v4/workflows/runs/{runId}/cancel

Response: 200 OK on success. Returns error if the run is already completed.

Clear Pending Runs

Cancels all pending runs for the department.

POST /api/v4/workflows/runs/clear

Response: 200 OK with count of cancelled runs.

Workflow Health

Returns health metrics for a specific workflow.

GET /api/v4/workflows/{id}/health

Response: WorkflowHealthResult

FieldTypeDescription
TotalRuns24hintTotal runs in last 24 hours
SuccessRuns24hintSuccessful runs in last 24 hours
FailedRuns24hintFailed runs in last 24 hours
TotalRuns7dintTotal runs in last 7 days
SuccessRuns7dintSuccessful runs in last 7 days
FailedRuns7dintFailed runs in last 7 days
TotalRuns30dintTotal runs in last 30 days
SuccessRuns30dintSuccessful runs in last 30 days
FailedRuns30dintFailed runs in last 30 days
SuccessRatePercentdoubleOverall success rate percentage
AverageDurationMslongAverage run duration in milliseconds
LastRunOndatetimeTimestamp of last execution
LastErrorstringMost recent error message

Event Types

Returns the list of available trigger event types with display names and descriptions.

GET /api/v4/workflows/eventtypes

Response: Array of event type descriptors with available template variables for each.

Event Type Enum Values

ValueNameDescription
0CallAddedNew call/dispatch created
1CallUpdatedExisting call updated
2CallClosedCall closed
3UnitStatusChangedUnit status changed
4PersonnelStaffingChangedPersonnel staffing level changed
5PersonnelStatusChangedPersonnel action status changed
6UserCreatedNew user added to department
7UserAssignedToGroupUser assigned to a group
8DocumentAddedDocument uploaded
9NoteAddedNote created
10UnitAddedUnit created
11LogAddedLog entry created
12CalendarEventAddedCalendar event created
13CalendarEventUpdatedCalendar event updated
14ShiftCreatedShift created
15ShiftUpdatedShift updated
16ResourceOrderAddedResource order created
17ShiftTradeRequestedShift trade requested
18ShiftTradeFilledShift trade filled
19MessageSentNew message sent
20TrainingAddedTraining created
21TrainingUpdatedTraining updated
22InventoryAdjustedInventory quantity changed
23CertificationExpiringCertification nearing expiry
24FormSubmittedForm submitted
25PersonnelRoleChangedUser role assignment changed
26GroupAddedDepartment group created
27GroupUpdatedDepartment group updated

Action Types

Action Type Enum Values

ValueNameDescription
0SendEmailSend email via SMTP
1SendSmsSend SMS via Twilio
2CallApiGetHTTP GET request
3CallApiPostHTTP POST request
4CallApiPutHTTP PUT request
5CallApiDeleteHTTP DELETE request
6UploadFileFtpUpload file via FTP
7UploadFileSftpUpload file via SFTP
8UploadFileS3Upload file to Amazon S3
9SendTeamsMessagePost message to Microsoft Teams
10SendSlackMessagePost message to Slack
11SendDiscordMessagePost message to Discord
12UploadFileAzureBlobUpload file to Azure Blob Storage
13UploadFileBoxUpload file to Box
14UploadFileDropboxUpload file to Dropbox

Security & Rate Limits

Rate Limits

Workflow execution is rate-limited per department based on subscription plan:

LimitFree PlanPaid Plans
Executions per minute560
Daily run limit50Unlimited

Free-plan rate limits are strictly enforced with no exemptions for any event type.

Workflow & Step Caps

LimitFree PlanPaid Plans
Workflows per department328
Steps per workflow520
Credentials per department220
Max retry count (ceiling)55

Daily Send Limits

ChannelFree PlanPaid Plans
Emails per day10500
SMS per day5200

Recipient Caps

ActionFree PlanPaid Plans
Email (To + CC)1 (no CC)10
SMS (To)15

SSRF Protection

  • HTTP API calls require HTTPS only
  • Private/internal IPs (RFC 1918, loopback, link-local, cloud metadata 169.254.169.254) are blocked
  • FTP/SFTP hosts are subject to the same private-IP restrictions

Webhook URL Validation

  • Teams: hostname must end with .webhook.office.com or .logic.azure.com
  • Slack: hostname must be hooks.slack.com
  • Discord: hostname must be discord.com or discordapp.com with path starting /api/webhooks/

Template Sandboxing

ProtectionLimit
Loop iterations500 max
Recursion depth50 max
Regex timeoutEnforced
Output template size (save)64 KB
Rendered content size256 KB
import/include built-insDisabled

Email HTML Sanitization

Rendered email body HTML is sanitized before sending. Dangerous elements (<script>, <iframe>, <object>, <embed>, <form>), on* event attributes, and javascript: URLs are stripped.

Dynamic Action Config Rendering

All action config text fields (Subject, To, CC, filenames, URLs) are rendered through the Scriban template engine at execution time, allowing {{ }} expressions. The same 256 KB rendered content size cap applies.

Credential Types

Credential Type Enum Values

ValueNameDescription
0SmtpSMTP email server
1TwilioTwilio SMS service
2FtpFTP server
3SftpSFTP server
4AwsS3Amazon S3
5HttpBearerHTTP Bearer token authentication
6HttpBasicHTTP Basic authentication
7HttpApiKeyHTTP API Key authentication
8MicrosoftTeamsMicrosoft Teams Incoming Webhook
9SlackSlack Incoming Webhook
10DiscordDiscord Webhook
11AzureBlobStorageAzure Blob Storage
12BoxBox cloud storage
13DropboxDropbox cloud storage

Run Status Values

ValueNameDescription
0PendingQueued for processing
1RunningCurrently executing
2CompletedFinished successfully
3FailedFailed after all retries
4CancelledCancelled by user
5RetryingFailed, waiting for retry