Workflows
In this article we cover what a workflow is, how to build one, the triggers and actions you can choose from, how to test a workflow before turning it on, and how to check what it did afterward.
Workflows are part of the Pro and Enterprise plans.
What is a workflow
A workflow tells Cubrel: "when this happens to a record, and these conditions match, do these things." For example:
1 day after a ticket's Resolution Due At date, if the ticket is still open, notify the support lead and create a task for the ticket's owner due the same day.
Each workflow has three parts, shown top to bottom in the builder:
- Trigger: what starts it.
- Conditions (optional): which records it applies to.
- Actions: what it does, in order.
Workflows and conversion rules work well together. A conversion rule turns one record into another, for example a Quote into an Order. A workflow can do several things at once, and one of those things can be running a conversion rule.
Creating a workflow
Go to Workspace > Automation > Workflows > New Workflow, then:
- Give it a name and pick the module it watches. This can be any active module except Users, User Invites, Workspace and Roles. The module can't be changed after saving.
- Choose what starts the workflow in the When row.
- Optionally add conditions with Add a condition to limit which records it applies to.
- Add one or more steps with the + on the line, or with What should happen? while there are none yet.
- Save. A new workflow starts as a Draft until you switch on Active.
The builder reads from top to bottom as sentences along a line, for example "When a record reaches a date: 30 days before its Vaccinated Until at 08:00, if its Status is Active, Then send the Reminder email to Email." Every underlined word is a blank: click it to pick or type its value in a small picker right there.
Steps with many options (Send email, Notify user and Create record) keep a short sentence. Click the blank with the sliders icon, or the sliders tool on the step, to open all their options in a window. Changes in the window are only applied when you click Apply; if you close it with unapplied changes, Cubrel asks before discarding them. CC and attachments of an email show as a short line under its sentence.
When you save, Cubrel checks that every blank is filled in. Empty blanks turn red, and the top bar shows how many are left.
Triggers
| Trigger | Runs when |
|---|---|
| Record created | A new record is added. |
| Record updated | Any change is saved to a record. Saving without changing anything doesn't count. |
| Field changed | A specific field changes. You can also set a from value, a to value, or both, for example "Status changes from Draft to Approved." Leave either empty to match any value. |
| Date based | A number of days before or after a date field, at a time you choose, for example "30 days before Due Date, at 08:00." |
Record triggers fire no matter how the record was changed: in the app, through the REST API, or by another workflow. Imports are the exception: records created or updated by an import don't start workflows.
How date triggers work
- Cubrel checks date workflows once every hour, using your organization's timezone. That's why the time is set in whole hours.
- Each record is handled once per date value. If someone changes the date later, the workflow is scheduled again for the new date.
- Conditions are checked on the trigger day, not when the date was entered. A record that doesn't match on that day is skipped.
- If Cubrel was unavailable for a while, records that fell due in the last three days are still picked up.
When you turn on a date workflow, Cubrel tells you how many records already fall within its date window and asks what to do with them:
- Include these records: they're handled on the next hourly run.
- Only records that qualify from now on: the existing ones are skipped.
Conditions
Conditions work like list filters: pick a field, an operator and a value. Each condition is its own row, and you add the next one with and or or if:
- and adds the row to the current group. Every row in a group must match.
- or if starts a new group.
The workflow runs when any group fully matches. For example, "if its Status is Open and its Priority is High, or if its Customer is VIP" runs for open high-priority records and for every VIP. Click a row's and or or if to change how it joins.
A workflow without conditions runs every time its trigger fires.
Actions
Actions run one after another, in the order shown. Hover a step to see its tools: move it up or down, open its options, duplicate it, switch it off temporarily without deleting it, or delete it. On phones the tools are always shown.
Send email
Sends one of the module's email templates, filled in with the record's data.
- To and CC can be an email field on the record, an email field on a related record (for example the contact linked to a deal), or an address you type in.
- Invalid and duplicate addresses are left out automatically.
- The email is sent through your normal outbound mail setup and saved as an email on the record, just like an email sent by hand.
If the module has no templates yet, the action offers a link to create one; click Refresh afterward to see it.
Attachments are optional. Add one of the module's PDF templates and choose how it's attached:
| Option | What gets attached |
|---|---|
| Generate new | A fresh PDF, created for the record when the email is sent |
| Use latest | The newest PDF already generated from that template for the record; if there isn't one yet, a new one is created |
"Use latest" fits flows like "send the quote when its status changes to Sent": the customer gets the same PDF you already generated, and no duplicate is created. Every attached PDF is saved as a Document on the record. All attachments together can be at most 7 MB; a larger email isn't sent and shows as Failed.
Create record
Adds a new record in any module, such as a follow-up task. For each field you want to fill, pick a value (see Setting values below).
By default the new record is linked to the record that started the workflow, as long as the two modules are related. Switch off Link the new record to this record if you don't want that.
If you don't set an owner, the new record belongs to whoever saved the record that started the workflow, or to the super admin for date triggers. Either way, the owner must be able to view the new record's module, or the action fails.
Update field
Changes a field on the record that started the workflow, or on every record linked to it through a relationship (for example, all contacts of an account).
Read-only and calculated fields can't be changed. The owner can, so a workflow can reassign records, as long as the new owner can view the module. Otherwise the action fails.
TIP
If a workflow updates the same record that started it, the builder shows a note. The workflow won't run itself again, but the change can start other workflows on the same module.
Notify user
Sends an in-app notification to one or more people: specific users, the record owner, and/or the workflow creator. Write the message yourself and insert field values with the @ button. The notification links straight to the record. Only active users receive it.
Run conversion rule
Runs one of the module's enabled conversion rules on the record, the same way an automatic conversion would.
Generate PDF
Creates a PDF of the record from one of the module's PDF templates and saves it as a Document on the record. The action can't be saved without a template, and a template a workflow uses can't be deleted.
The PDF is created in the background, so the run shows Completed right away. If the PDF can't be created, the run changes to Failed and the workflow's creator gets a notification.
TIP
Later actions don't wait for the PDF. To email it, use an attachment on Send email set to Generate new in place of a separate Generate PDF action.
Branches
A Branch step sends records down different paths, so one workflow can do "if the deal is over 10,000, notify the sales lead; otherwise create a task for the owner."
- The paths fan out into colored lanes side by side, each with its own name, conditions and steps. Lanes are checked from left to right, and the record takes the first path that matches. On phones the lanes are stacked.
- A record that matches no path takes Otherwise. You can rename it, for example to "Everyone else"; it keeps catching every record the other paths don't.
- Steps above the branch run for every record. A branch is always the last step in its list; everything after it goes inside a path. Paths don't join back together.
- A path can stay empty. That means "do nothing more for these records."
- A path can hold another branch, up to three levels deep.
- The branch checks the record as it is at that moment, so it sees changes made by steps above it.
Add a branch with the + below the last step and pick Branch. In a lane's tab you can click the name to rename the path, move it left or right, or remove it. Add path in the Otherwise lane adds another one. Each lane's conditions use and and or if just like the workflow's own.
Do different things per value is a shortcut in the same menu: pick a field with fixed values, such as Status, and Cubrel adds one path per value plus Otherwise. It's saved as a normal branch, so you can rename, remove or change its paths afterward.
TIP
The workflow's own conditions still decide whether it runs at all. Use a branch only when matching records need different steps.
Setting values
When an action sets a field (Create record, Update field), you choose how the value is filled:
| Value | Available for | Example |
|---|---|---|
| Fixed value | All fields | Status = "Open" |
| From this record | All fields | Due date = the record's Renewal Date |
| Relative date | Date fields | Today + 7 days |
| Text with fields | Text fields | "Call @Name about @Product" |
| Record owner | User fields | Assigned to = the record's owner |
"From this record" only offers fields whose type fits the field you're filling, so you can't copy a date into a number field by mistake.
Testing a workflow
Click Test run in the top bar and pick any record. A bar opens under the top bar with the record, the overall result and Run again. The details show right on the steps: what the workflow would do for that record, without sending, creating or changing anything:
- Trigger: whether it would fire. For date triggers, the exact day and time it's scheduled for.
- Conditions: each condition gets a check mark or a cross.
- Branches: the lane the record would take is highlighted, and the others are dimmed with a check mark or cross on each of their conditions.
- Actions: what each one would do, shown under the step. Steps the record wouldn't reach are dimmed. For an email you see the recipients, subject, the full text in your company's email layout, and which attachments it would get (no PDFs are created during a test); for a new record, its field values; for an update, each record's old and new value.
The test uses what's currently in the builder, even if you haven't saved yet. If an action would fail, for example because no recipient has a valid email address, the test shows the error on that step so you can fix it first. After you change the workflow, click Run again to see the new result. Click the record's name to test another one, and Close test to hide the results.
Checking what a workflow did
Open a workflow and switch to the Run history tab. Every run is listed with its time, record, trigger, result and duration. Click a run to see what each action did, for example "Email Reminder queued for anna@example.com."
| Result | Meaning |
|---|---|
| Completed | All actions ran. |
| Failed | An action failed. The run stopped there, since later actions often depend on earlier ones. |
| Skipped | A date trigger fired but the conditions didn't match on that day. |
A branch shows up in a run as "Took the path …", followed by the paths that didn't match.
A failed run can be retried. The retry starts at the action that failed, using the workflow's current settings, so you can fix the cause first and then retry. A retry follows the path the run already took, even if the record has changed since; branches the run hadn't reached yet are checked fresh. Once a retry goes through, the failed run no longer offers Retry.
When a run fails, the workflow's creator gets a notification with a link to the workflow. Run history is kept for 90 days by default; admins can change this under Workspace > Data & Security > Data Retention.
Turning workflows on and off
A workflow only runs while it's Active. You can switch it on or off in the builder's top bar or with one click on the Workflows list. A workflow needs at least one action that's switched on before it can be activated.
The Workflows list can be searched by name and filtered by module and status. It shows each workflow's trigger, when it last ran, and how many runs and failures it had in the last 30 days.
Deleting a workflow also deletes its run history. Emails it sent, records it created and fields it changed stay as they are.
Built-in safety
- A failing workflow never stops the record from being saved.
- A workflow runs at most once per record per save, even if its own actions change that record again.
- Workflows can start other workflows, but only up to three levels deep, so two workflows can't keep triggering each other forever.
- Notifications caused by a workflow show the workflow's name as the sender, so you can tell automatic changes from a colleague's.
In short
| Question | Answer |
|---|---|
| Which plan includes workflows? | Pro and Enterprise |
| Can a date workflow run twice for the same record? | Only if the date value changes |
| When are a date workflow's conditions checked? | On the trigger day |
| Does a test run send emails or change records? | No, it's a simulation only |
| What happens when an action fails? | The run stops, the creator is notified, and you can retry from that action |
| Does a failing workflow block saving the record? | No |
| Can I activate a workflow without actions? | No, it needs at least one action that's switched on |
| Does deleting a workflow undo what it did? | No, only the workflow and its run history are removed |
| How long is run history kept? | 90 days by default, adjustable under Data Retention |