Automation
People and message steps
Send email, reply in inbox threads, notify members, request approvals, and look up users and groups from a workflow.
These steps reach people: by email, with a notification in SAPUGO, or by asking them to approve something. Others look up users and groups so later steps can use a name or an email address.
Email#
| Step | What it does |
|---|---|
| Send Email | Sends an email to the addresses you give it, with a subject and an HTML body, and optional cc, bcc and attachments. Use it for people outside SAPUGO, such as customers and suppliers. |
| Reply to Email Thread | Replies inside an existing shared inbox conversation. Use it when the workflow was started by an incoming email and the answer belongs in that thread. |
| Break Email | Splits an incoming email into its parts: sender, recipients, subject, body, attachments, and when it arrived. |
To build the email body, use the Template value to fill placeholders with record values.
Attach files to an email#
Send Email has an optional attachments input. It takes a list of attachment ids, which are files already stored in SAPUGO, and adds each one to the email.
To send a PDF made from a stencil:
- Add Generate Document, turn on Upload to attachment, and connect an Attachment Scope from Entry so the PDF is stored on a record.
- Put the step's attachment_id output into a list, for example with Make Array.
- Connect that list to attachments on Send Email.
In workflow code this is email.send(to: ..., subject: ..., body_html: ..., attachment_ids: [doc.attachment_id]).
Read invoices from incoming email#
To process e-invoices that suppliers send to a shared inbox, have the inbox rule start a workflow, then use Break Email, loop over attachments with For Each, load each one with Download Attachment, and pass it to Read E-Invoice. Attachments that are not e-invoices take the Not an e-invoice branch. See E-invoicing.
Notifications in SAPUGO#
Notifications appear in the person's inbox in SAPUGO and follow their notification preferences. Each can point at a record, so clicking the notification opens it.
| Step | Who receives it |
|---|---|
| Notify Users | Specific members. |
| Notify Groups | Every member of one or more groups. |
| Notify Subscribers | People who follow a table or a record. |
Each step returns how many people were notified.
Approvals#
Request Approval pauses the run and asks people or groups to decide.
- Add Request Approval and give it a title and a message that explains the decision.
- Pick the users, the groups, or both who can decide.
- Optionally add questions for the approver to answer, and a timeout.
- Optionally point it at the record the decision is about, so approvers can open it.
- Connect what should happen to the Approved, Rejected, and Timeout paths.
The request appears on the Approvals page for each assignee, who can Approve or Reject and add a comment. The step outputs the decision, who decided, when, the comment, and any answers.
Put the writes that depend on the decision on the Approved path. Never wait for an approval inside a transaction.
Users and groups#
| Step | What it does |
|---|---|
| Current User | The person who started the run. It's empty when a schedule or another system started the run, so check its found output before using it. |
| User from Id | Loads a member from an ID, such as the value of a Person column. |
| Group from Id | Loads a group from an ID. |
| Group Members | Lists the active members of a group. |
| Break User | Splits a user into fields: name, email, whether they own the organization, their groups, and more. |
| Break Group | Splits a group into its ID, name, and description. |
Checking what kind of value you have#
| Step | What it does |
|---|---|
| Is Class? | Answers whether a value is of a given kind, such as a record, a file, or a user. |
| Cast Object | Continues on Success when a value is the expected kind, and on Fail when it isn't. |
Plan your messages#
For each message, say who receives it and whether it's an email or a notification in SAPUGO. For an approval, name who decides, the question, the timeout, and what each path does. A scheduled workflow has no current user, so name the person or group it should notify instead.
Discussions about this page
Stuck, or found something missing? Ask the community.