Skip to main content

Workflow automation

The Workflow Automation module runs steps for you when something happens: a record is created or changed, a schedule is due, a date approaches, or someone selects Run now. Workflows check conditions, ask people for approval, wait, call webhooks and run actions provided by other modules, such as creating a task, sending an email or approving an expense claim.

Before you begin​

  • The Workflow Automation module must be enabled for your organization. Some modules, such as Expenses, require it.
  • Building workflows needs Create, edit and run workflows; viewing them and their runs needs View workflows and their runs. By default only administrators have these.
  • Anyone can decide the approvals assigned to them. No permission is needed.
warning

Workflow steps run with the organization's full permissions, whoever triggered them. Grant Create, edit and run workflows only to trusted roles.

Key concepts​

TermMeaning
WorkflowA trigger, optional conditions and a list of steps. Each workflow can be enabled or disabled.
TriggerWhat starts the workflow: a record change, a schedule, a date, or a manual start.
ConditionsRules the triggering record must match for the workflow to run.
StepOne thing the workflow does: request approval, wait, send a webhook, or run an action. Steps run in order.
RunOne execution of a workflow, with a log of each step.
ApprovalA request for one or more people to approve or reject before the run continues.

The workflows list​

Select Automation in the main menu (/m/automation). Each workflow shows its trigger, its number of steps, run counts (including how many are waiting or failed), the Last run and, for scheduled workflows, the next run. The Enabled switch turns a workflow on or off.

The list of workflows.

My approvals opens your approvals inbox.

Create a workflow​

  1. On the Automation page, select New workflow (or choose Create a workflow in the command palette).
  2. Enter a Name (for example Approve new companies) and, optionally, a Description.
  3. Set the trigger.
  4. For record and date triggers, add conditions if the workflow should only run for some records.
  5. Add steps with Add step.
  6. Select Create workflow.

New workflows are disabled. When you're ready, turn on the Enabled switch, on the workflow's page or in the list.

Editing a workflow: trigger, conditions and steps.

To change a workflow later, open it and select the Edit tab, then Save workflow. Each save increases the workflow's version. Runs already in progress keep the version they started with.

Triggers​

Under Trigger, choose how the workflow starts:

TriggerSettingsStarts when
When a record changesRecord type, Event (Created, Updated or Deleted). For Updated, optionally Only when these fields change.A record of that type is created, updated or deleted.
On a scheduleRepeat: Every hour (at a Minute past the hour), Every day or Every week (on a Day) at a Time.The scheduled time arrives, in the organization's time zone (from organization settings).
On a dateRecord type, Date field, When (a number of days before or after, or On the day) and At (an hour).That many days before or after the record's date, for example 3 days before a task's due date.
Manually (Run now)None.Someone selects Run now on the workflow's page.

Any record type that an enabled module declares can be used, for example Contact, Company, Lead, Opportunity, Quotation, Bill, Expense claim, Form response, Task, Note, File, Organization unit and User. Custom fields are included.

:::note On a date Only records created or changed after the workflow is enabled get a start time; existing records are picked up the next time they change. Changing the date moves the start time. Each start time is used once. :::

Conditions​

For When a record changes and On a date triggers, Conditions limit the records the workflow runs for. Without conditions, it runs for every matching event.

  1. Select Add condition.
  2. Choose a Field (custom fields included), an Operator and a Value.
  3. With several conditions, choose to Match all or any of them.

Operators: is, is not, contains, does not contain, starts with, is one of, is greater than, is at least, is less than, is at most, is empty, is not empty, changed and changed to. Text comparisons ignore upper and lower case.

Steps​

Select Add step and choose a step type. Steps run in order; approvals and waits pause the run. Use Move up and Move down to reorder steps.

StepWhat it does
Request approvalAsks people to approve or reject. See below.
WaitPauses the run for a number of Minutes, Hours or Days.
Send a webhookSends an HTTP POST with the workflow, run, trigger, record, previous values, changes, the person who made the change and the last approval as JSON, to a URL.
Module actionsRuns an action provided by Workflow Automation or by another module. See Actions.

Request approval​

FieldMeaning
Title and MessageWhat the approvers see ("What the approvers should check").
ApproversPeople, and/or Or everyone with a role. Role holders are resolved when the approval is requested; only active members are asked.
NeedsOne approver (first decision counts) or Every approver (one rejection rejects).
If rejectedStop the workflow, or Continue (steps can run "if rejected").
The person who made the change cannot approve itFour-eyes principle.
Escalate if nobody decidesAfter Escalate after (hours) (1 to 720) without a decision, the people and roles in Escalate to are asked too and notified.

Run a step only after approval or rejection​

Steps placed after an approval have a Run this step setting: Always, Only if the last approval was approved or Only if the last approval was rejected. Combined with If rejected: Continue, this lets one workflow handle both outcomes.

Webhooks​

For a Send a webhook step, enter the URL. Optionally enter a Signing secret: each request then carries an X-Modulix-Signature: sha256=<HMAC of the body> header so the receiver can verify it. Webhooks only reach public internet addresses and don't follow redirects. Administrators can turn webhook steps off (they then fail) and set their timeout in settings.

Variables in text fields​

Text inputs accept variables, inserted with the Insert a variable button, for example:

VariableValue
{{record.id}}, {{record.name}}…A field of the triggering record.
{{previous.status}}…A field's value before the change.
{{actor.id}}, {{actor.name}}The user who made the change.
{{approval.status}}, {{approval.comment}}The last approval's result and comment.
{{workflow.name}}, {{run.id}}The workflow and the run.

Actions​

Under Module actions, the Add step menu lists the actions of the enabled modules. Each action has its own inputs.

ActionProvided byWhat it does
Update a fieldWorkflow AutomationChanges a field of a record (Record type, Record ID, Field, New value). Works on custom fields (customFields.<key>) and on the fields their module allows, such as those of contacts, companies and tasks. An empty value clears the field.
Set a user's statusCoreSets a member to Active, Suspended or Deactivated.
Send a notificationNotificationsNotifies members (Recipients (user IDs), Title, Message, Link) through the channels each chose for Messages.
Send an emailNotificationsEmails any address (To, Subject, Message) through the organization's email provider.
Create a noteNotesAdds a note to the Notes board (Title, Content, Color, Pinned).
Create a taskActivities & TasksCreates a task, optionally about the triggering record, due in a number of days.
Change a task's statusActivities & TasksSets a task to To do, In progress, Done or Cancelled.
Create a contactContactsAdds a person; the company is found by name or email domain, or created.
Create a leadLeadsAdds a lead, or updates the lead with the same email.
Move a lead to a stageLeadsMoves a lead to a stage, with an optional disqualification reason.
Assign a leadLeadsTo a person, or by the assignment rules when no person is given.
Send a payment reminderSalesEmails the reminder for an unpaid invoice.
Approve an expense claimExpensesApproves a submitted claim, with an optional comment.
Reject an expense claimExpensesRejects a submitted claim; a comment is required.

If a step uses an action whose module has been disabled, the step shows that the action is not available.

Example: expense claim approval​

  1. Trigger: When a record changes, Record type Expense claim, Event Updated.
  2. Condition: Status changed to Submitted.
  3. Step 1: Request approval from the finance managers' role, If rejected: Continue.
  4. Step 2: Approve an expense claim with Claim (id) {{record.id}}, Run this step: Only if the last approval was approved.
  5. Step 3: Reject an expense claim with Claim (id) {{record.id}} and Why (required) set to {{approval.comment}}, Run this step: Only if the last approval was rejected.

See Expenses for how claims are approved without workflows.

Run a workflow manually​

Workflows with a Manually (Run now) or On a schedule trigger can be started at any time: open the workflow and select Run now.

Runs​

Each workflow's page has a Runs tab listing its runs: when each Started and by whom (or by a workflow), its Status, the Record and the Progress through the steps. Select a run to open its panel.

A run's details and step log.

The run panel shows the trigger, the record, who made the change, when a waiting run resumes, any error, and the log of each step with its outcome (Done, Failed, Skipped, Waiting, Cancelled, Not reached), outputs and approval decisions.

Run statusMeaning
QueuedAbout to run.
RunningExecuting steps.
WaitingPaused by a Wait step or an approval.
CompletedEvery step finished.
FailedA step failed. The workflow's creator or last editor is notified.
RejectedAn approval was rejected and the workflow stopped.
CancelledCancelled by someone, or because the workflow was deleted.
  • Cancel run stops a queued, waiting or failed run, and cancels its open approvals.
  • Retry restarts a failed run from the step that failed.

Starting a workflow never blocks the change that triggered it. Changes made by a run never start the same workflow again, and workflows started by other workflows stop after three levels.

Approvals​

When a workflow asks you to decide, you're notified (Approval requests) and the request appears:

  • in Approvals in the main menu (/m/automation/approvals), also reachable with My approvals;
  • as a badge in the top bar showing how many approvals wait for you;
  • in the Waiting for your approval widget on the dashboard.
Your approvals inbox.

To decide:

  1. Open Approvals. The Waiting for me tab lists open requests with who requested them and whether One approval is enough or Everyone must approve.
  2. Select Approve or Reject.
  3. Optionally add a Comment (it is available to later steps as {{approval.comment}}), then confirm.

The workflow continues right away. The History tab lists requests you decided and those settled by others. The person whose change started the request gets an Approval decisions notification.

To hide the dashboard widget, open your Profile and turn off Show pending approvals on the dashboard under Workflow Automation preferences.

Delete or pause a workflow​

To pause a workflow, turn off Enabled. To delete it, open it, select the delete icon (Delete workflow) and confirm. Runs in progress are cancelled with their open approvals; past runs stay in the history.

Settings​

Administrators set these on Administration → Settings, Workflow Automation tab:

SettingDefaultWhat it does
Allow workflows to send webhooksOnWhen off, webhook steps fail instead of sending.
Webhook timeout (seconds)10How long a webhook may take, from 1 to 30 seconds.
Maximum enabled workflows100How many workflows can be enabled at once, up to 500.

Personal preference (in your Profile):

PreferenceDefaultWhat it does
Show pending approvals on the dashboardOnShows or hides the Waiting for your approval widget.

Notifications​

NotificationSent whenDefault channels
Approval requestsA workflow needs your decision.In-app, email, push
Approval decisionsA request started by your change is approved or rejected.In-app
Failed workflow runsA workflow you created or last edited fails.In-app, email

These need the Notifications module. See Notifications.

Permissions​

PermissionWhat it allowsGranted by default to
automation.workflow.read — View workflows and their runsSee the Automation page, workflows and their runs.Admin
automation.workflow.manage — Create, edit and run workflowsCreate, edit, enable, disable, delete and run workflows; cancel and retry runs.Admin

Limitations​

  • Steps run one after the other: there are no parallel branches or loops.
  • On a date triggers don't scan records that existed before the workflow was enabled, and a run that is more than seven days late is dropped.
  • Update a field only changes fields their module allows, and custom fields.