Docs
On this page
reference3 min readApplication: Platform

Workflow activity reference

Every workflow activity type in the editor palette: what it does, whether it waits, its outputs and its settings.

This page lists the activity types you can place in a workflow, with the settings of each. Use it while you build a workflow in the editor. The ideas behind activities are in Workflow concepts.

Activity types

Activity Waits Outputs Purpose
Comment No None A note on the diagram. It does not run.
User action Yes, for a user One per transition you add Sets a status and offers the user actions on the form.
Approval Yes, for approvers Approve, Reject Asks users for approval and holds the record until they respond.
Complete No None Ends the workflow.
Scriptable No Success, Error Runs a server script once and moves on.
Scriptable (Async) Yes, until the script says it is done Success, Error Runs a server script and waits for an outside event.
Timer Yes, for a time Success, Error Waits for a duration, a date field or a scripted date.
If/Else No True, False Branches on a condition.
Switch No One per transition you add Branches on the transition code a script returns.
Switch (Async) Yes, until the script returns a code One per transition you add Branches like Switch, but waits for an outside event.
Run action Yes, until the action completes Success, Error Runs an intelligent action.
Email No Success, Error Sends an email.
Exception No Always Runs when an error occurs anywhere in the workflow.

Two further definitions, a record generator activity and a simple task activity, ship inactive and do not appear in the palette.

Status and approval activities

User action

A User action sets the record’s workflow status and waits. Each transition you add appears as an action on the form. The user selects one to move the record on.

Field Type Behaviour Purpose
Label Text Required. Shown on the form. The action name the user sees.
Code Text Required. Identifies the transition in permissions, scripts and Switch answers.
Order Number Higher numbers place the button further right on the form. Orders the actions.
Before Script Runs before the transition. Must end with return true; to let the form checks finish. Checks the record before it moves, for example that a field is filled.
Condition Script Decides whether the action is available. [UNVERIFIED] Hides actions that do not apply.
Execute on client Yes or no Runs the condition in the browser instead of on the server. Conditions that read the form.
On success Script Runs after the transition succeeds. Follow-up logic.
PermittedRoles List of roles Only users with one of the roles see the action. Restricts who can move the record.

Complete

A Complete activity sets its status and ends the workflow. It has no outputs.

Approval

An Approval creates an approval task for each approver and holds the record until the requirement is met. The Approve or Reject output then runs.

Field Type Behaviour Purpose
Approval requirement Choice All approvals required, One approval required, At least one approval per group, Percentage of approvals required or Scripted. How many approvals the record needs.
Percentage required Decimal Used with Percentage of approvals required. The approval is rejected as soon as the share can no longer be reached. The share of approvers who must approve.
Approval requirement script Script Shown when the requirement is Scripted. Set answer to true to approve or false to reject. Requirements the other options cannot express.
Complete on first rejection Yes or no Shown for One approval required and Percentage of approvals required. Moves on at the first rejection.
Force Comment Yes or no Approvers must enter a comment to approve or reject. Records the reason for each decision.
Assignees Users Each user gets an approval task. Fixed approvers.
Groups Groups Each member gets an approval task. With At least one approval per group, each group must approve once. Approval by team.
Dynamic approver source Field path A path from the record to a field that holds a user, a list of users or a group, such as Approver on Work. Approvers chosen on the record.
Advanced approval Yes or no Shows Business logic. Approvers that depend on the record.
Business logic Script Returns user records from a query. See the examples below. Scripted approvers, such as the requester’s manager.
Approve if no assignees Yes or no With no approvers found, approves if on and rejects if off. Avoids records stuck at an approval with nobody to ask.
Subject Text Shown on forms and notifications. Names the approval, for example “CAB approval”.
Instructions Text Shown on forms and notifications. Tells approvers what to check.

This Business logic script asks the members of a group whose ID is held in an application property:

let approverArr = Table("Group")
    .get(ApplicationPropertyManager.getProperty("change.approval.cab_group_id"))
    .relation("Member")
    .map(approver => approver.Id());
if (approverArr.length !== 0) {
    Table("User").IN("id", approverArr).map(r => r);
}

This one asks the manager chosen in a catalog item question named EOManager:

if (current.questions().EOManager.hasValue()) {
    Table("User").EQUAL("id", current.questions().EOManager.value()).map(r => r);
}

Script activities

Scriptable

A Scriptable activity runs its Script once and moves on through Success. If the script throws an error, the record follows Error. It sets no workflow status. Use it to set fields, send a scripted notification or call an integration. You do not need current.update() to save field changes.

Scriptable (Async)

A Scriptable (Async) activity waits for something outside the workflow, such as an integration reply or the closure of subtasks. It sets a workflow status so the record shows that it is waiting.

Field Type Behaviour Purpose
Initialization script Script Runs once when the activity starts. Starts the work, for example raises subtasks or calls an integration.
Evaluate script on start Yes or no Runs Script straight after the initialization script. Moves on at once if the work is already done.
Script Script Runs each time the activity is evaluated. Return true to move on. Return ActivityOptions.DELAY_EVALUATION, false or nothing to keep waiting. Decides whether the wait is over.

Something must make the workflow evaluate again. The table property workflow.trigger.parent.field does this for related records. Set it on the child table to the relationship that points at the parent, or to a comma-separated list. For example, the value ParentHRCase on HRCaseTask re-evaluates the parent HR case’s workflow whenever one of its tasks is updated.

The workflow.trigger.parent.field property set on a task table.

Script variables

Workflow scripts receive these variables.

Variable Type Purpose
current Table record The record the workflow runs for.
context Object State kept with the workflow between activities.
log Logger Writes to the workflow history log.
action Object The action that caused the evaluation.
ActivityOptions Constants Holds DELAY_EVALUATION for asynchronous activities.

Branching activities

If/Else

An If/Else activity tests the record against its If Else Condition. It follows True if the record matches and False if it does not.

Switch

A Switch runs its Script and follows the transition whose Code the script returns in answer. Add one transition for each path, in the same way as on a User action. To find a transition’s code, double-click the transition. A Switch sets no workflow status.

A Switch activity with three outgoing transitions.

The script can read current and, for records submitted from the catalog, the answers in current.questions().

Switch (Async)

A Switch (Async) has an Initialization script and a Script, like Scriptable (Async). It waits until the script returns a transition code, then follows that transition.

Other activities

Timer

A Timer waits, then follows Success. Set Timer type to one of these values.

Field Type Behaviour Purpose
Fixed duration Timer type Waits for Duration. A set delay, such as a wait before automatic closure.
Related field Timer type Waits until the date in Related field. Follows Error if the field is empty. Moves on at once if the date has passed. A date held on the record.
Script Timer type Waits until the date the script returns in answer. A calculated date, such as a catalog answer.

A short fixed timer at the start of a workflow lets the record finish being created before an approval starts.

A Timer activity set to a fixed duration of two seconds.

Email

An Email activity sends one email and moves on.

Field Type Behaviour Purpose
Subject Text Sent as the email subject. Says what the email is about.
Body HTML Sent as the message. The email content.
To, Cc, Bcc Users Used when Advance is off. Fixed recipients.
Advance Yes or no Switches to the Recipients script. Recipients that depend on the record.
Recipients Script Returns the To, Cc and Bcc addresses. Scripted recipients.
Messaging account Messaging account Uses the active default SMTP account when empty. The account the email is sent from.

Run action

A Run action activity queues the intelligent action named in Action and waits for it to finish. It follows Success or Error according to the action result. See Intelligent actions.

Comment and Exception

A Comment places a note on the diagram and never runs. An Exception activity runs when an error occurs during workflow processing. Link its Always output to the activity that should handle the error.

Last updated 24 November 2026commit 88e011e506a8Chris Jones
Back to top