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.
Workflow steps run with the organization's full permissions, whoever triggered them. Grant Create, edit and run workflows only to trusted roles.
Key concepts
| Term | Meaning |
|---|---|
| Workflow | A trigger, optional conditions and a list of steps. Each workflow can be enabled or disabled. |
| Trigger | What starts the workflow: a record change, a schedule, a date, or a manual start. |
| Conditions | Rules the triggering record must match for the workflow to run. |
| Step | One thing the workflow does: request approval, wait, send a webhook, or run an action. Steps run in order. |
| Run | One execution of a workflow, with a log of each step. |
| Approval | A 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.
My approvals opens your approvals inbox.
Create a workflow
- On the Automation page, select New workflow (or choose Create a workflow in the command palette).
- Enter a Name (for example
Approve new companies) and, optionally, a Description. - Set the trigger.
- For record and date triggers, add conditions if the workflow should only run for some records.
- Add steps with Add step.
- 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.
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:
| Trigger | Settings | Starts when |
|---|---|---|
| When a record changes | Record 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 schedule | Repeat: 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 date | Record 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.
- Select Add condition.
- Choose a Field (custom fields included), an Operator and a Value.
- 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.
| Step | What it does |
|---|---|
| Request approval | Asks people to approve or reject. See below. |
| Wait | Pauses the run for a number of Minutes, Hours or Days. |
| Send a webhook | Sends 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 actions | Runs an action provided by Workflow Automation or by another module. See Actions. |
Request approval
| Field | Meaning |
|---|---|
| Title and Message | What the approvers see ("What the approvers should check"). |
| Approvers | People, and/or Or everyone with a role. Role holders are resolved when the approval is requested; only active members are asked. |
| Needs | One approver (first decision counts) or Every approver (one rejection rejects). |
| If rejected | Stop the workflow, or Continue (steps can run "if rejected"). |
| The person who made the change cannot approve it | Four-eyes principle. |
| Escalate if nobody decides | After 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:
| Variable | Value |
|---|---|
{{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.
| Action | Provided by | What it does |
|---|---|---|
| Update a field | Workflow Automation | Changes 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 status | Core | Sets a member to Active, Suspended or Deactivated. |
| Send a notification | Notifications | Notifies members (Recipients (user IDs), Title, Message, Link) through the channels each chose for Messages. |
| Send an email | Notifications | Emails any address (To, Subject, Message) through the organization's email provider. |
| Create a note | Notes | Adds a note to the Notes board (Title, Content, Color, Pinned). |
| Create a task | Activities & Tasks | Creates a task, optionally about the triggering record, due in a number of days. |
| Change a task's status | Activities & Tasks | Sets a task to To do, In progress, Done or Cancelled. |
| Create a contact | Contacts | Adds a person; the company is found by name or email domain, or created. |
| Create a lead | Leads | Adds a lead, or updates the lead with the same email. |
| Move a lead to a stage | Leads | Moves a lead to a stage, with an optional disqualification reason. |
| Assign a lead | Leads | To a person, or by the assignment rules when no person is given. |
| Send a payment reminder | Sales | Emails the reminder for an unpaid invoice. |
| Approve an expense claim | Expenses | Approves a submitted claim, with an optional comment. |
| Reject an expense claim | Expenses | Rejects 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
- Trigger: When a record changes, Record type Expense claim, Event Updated.
- Condition: Status changed to Submitted.
- Step 1: Request approval from the finance managers' role, If rejected: Continue.
- Step 2: Approve an expense claim with Claim (id)
{{record.id}}, Run this step: Only if the last approval was approved. - 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.
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 status | Meaning |
|---|---|
| Queued | About to run. |
| Running | Executing steps. |
| Waiting | Paused by a Wait step or an approval. |
| Completed | Every step finished. |
| Failed | A step failed. The workflow's creator or last editor is notified. |
| Rejected | An approval was rejected and the workflow stopped. |
| Cancelled | Cancelled 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.
To decide:
- Open Approvals. The Waiting for me tab lists open requests with who requested them and whether One approval is enough or Everyone must approve.
- Select Approve or Reject.
- 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:
| Setting | Default | What it does |
|---|---|---|
| Allow workflows to send webhooks | On | When off, webhook steps fail instead of sending. |
| Webhook timeout (seconds) | 10 | How long a webhook may take, from 1 to 30 seconds. |
| Maximum enabled workflows | 100 | How many workflows can be enabled at once, up to 500. |
Personal preference (in your Profile):
| Preference | Default | What it does |
|---|---|---|
| Show pending approvals on the dashboard | On | Shows or hides the Waiting for your approval widget. |
Notifications
| Notification | Sent when | Default channels |
|---|---|---|
| Approval requests | A workflow needs your decision. | In-app, email, push |
| Approval decisions | A request started by your change is approved or rejected. | In-app |
| Failed workflow runs | A workflow you created or last edited fails. | In-app, email |
These need the Notifications module. See Notifications.
Permissions
| Permission | What it allows | Granted by default to |
|---|---|---|
automation.workflow.read — View workflows and their runs | See the Automation page, workflows and their runs. | Admin |
automation.workflow.manage — Create, edit and run workflows | Create, 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.