Workflow concepts
What a workflow is, how activities and transitions move a record, which workflow a record gets, and how versions apply.
A workflow is the process a record follows from creation to completion: its statuses, the actions users can take and the steps that run without a person. Workflows are versioned. A record runs the version that was published when it started, so a change reaches only new records. Read this before you build or change one, so you know which workflow a record runs and when your change takes effect.
What a workflow is
A workflow belongs to one table, for example Incident or ITSMRequest. Administrators manage workflows under Administration → Workflow → Workflows. Every workflow has these parts.
| Part | What it is |
|---|---|
| Activity | One step in the diagram: a status, an approval, a script, a timer or a branch. Each activity type is described in Workflow activity reference. |
| Transition | A link from one activity to the next. On a User action activity, each transition is an action a user can select on the form. |
| Initial activity | The activity a new record starts at. A workflow without an initial activity never starts. |
| Workflow status | The status a record shows while it waits at an activity, for example Work in progress. |
| Version | A published copy of the diagram. Records run the version that was published when they started. |
How a record moves
When a record is created, its workflow starts at the initial activity. Activities that do not wait, such as Scriptable, If/Else and Switch, run and pass the record straight on. The record stops at the first activity that waits.
Activities wait for one of three things:
- a person, at a User action (the user selects a transition) or an Approval (approvers respond)
- time, at a Timer
- an outside event, at Scriptable (Async), Switch (Async) or Run action
A waiting activity sets the record’s workflow status, so lists and forms show where the record is. Transient activities set no status of their own.
Most activities have a Success and an Error output. If a script fails, the record follows the Error output. An Exception activity catches errors that no other path handles.
Which workflow a record gets
A table can have several workflows, for example one per catalog item on ITSMRequest. Servicely chooses one when the record is created:
- If the record comes from a catalog item that names a workflow for the same table, that workflow runs.
- Otherwise Servicely reads the active workflows for the table and its parent tables, lowest Order first. Only workflows with an initial activity count.
- The first workflow whose condition matches wins. A workflow with no condition matches every record.
- A matching workflow that has a condition is preferred over one that has none.
Set Order so that a request raised directly, without a catalog item, gets the workflow you expect. A workflow with Order 10 is considered before one with Order 20.
The condition is either a query in Condition or, when Advanced is on, a script in Condition script.
Editing and versions
Only one administrator can edit a workflow at a time. You check it out to edit it, publish your changes and check it in again. Checked out by on the workflow shows who has it.
A change takes effect only when you publish it. Records already running keep the version they started with. Only records created after you publish get the new version. The Versions tab on the workflow lists every published version with its summary.
The record’s own form does not show which version it runs. The version is kept on the record’s workflow instance. To find it, open Administration → Workflow → Workflow instances. Related record in the list shows the record each instance belongs to. Open the instance for your record. Workflow version shows the workflow name and the date and time that version was published.
The steps are in Build a workflow.
Workflows and triggers
A trigger can run when a record moves along a transition: set On transition(s) on the trigger. Use this for logic that belongs to a status change, such as setting a field when work starts. See Triggers.