Workflows
Sequences of actions that execute in response to events
Overview
A workflow is a sequence of configurable actions triggered in response to source data arriving at Morf from a third party application .
Each time a workflow gets triggered, Morf generates a workflow execution. An execution describes the data that Morf received, the actions that occurred and the associated outcomes.
An action (or node) within a workflow is used to either control the path an execution takes, to fetch additional data from your integrated third party applications, or to store at or send data to an integrated application.
📊 Monitoring Workflow Activity
Events
When Morf receives a webhook from a third party application, Morf processes that webhook and generates an event. That event data is then used to trigger a workflow, control the flow of an execution, and configure destination actions.
Example events: Healthie Patient Created, Formsort Step Completed
You can see all of the events processed for your organization in the Morf dashboard under the Monitoring > Events tab.
Source events
Actions
Each action (or node) of a workflow requires different configuration. Some actions are highly configurable and allow for the definition of parameters in a dynamic way.
There are built-in Morf actions that allow you to store data and control the flow of an execution. And then there are third party application actions that allow you to fetch from or store data in your integrated applications.
Built-in Morf Actions
- Profile lookup: A profile lookup is used to determine which profile to associate the event and workflow execution with. Morf has recommended defaults for each source applications, but allows you to customize the lookup based on your needs and based on an individual workflow. E.g. for Formsort, you may want to use
responder_uuid
as a lookup for one flow, butemail_address
for a different flow. - Update profile properties: This action allows you to store data from the source event to the Morf Profile as properties. There are many uses for storing data in properties, they allow you to use
email_address
for profile lookup, to stage data from a signup form to be used later when a record is created in an EHR, to store a tracking id, e.g. Google click id (gclid
), etc… - Filters: Filters allow you to control the path that a workflow takes using boolean logic. They allow you to trigger certain actions only if the specified expression is
true
, e.g. if an email address is submitted, create the contact in a CRM. We use the Common Expression Language to express this logic. - Wait: A wait, allows you to pause a workflow for a specified duration, e.g. if you want to wait until 24 hours before an appointment to trigger an action.
Third Party Actions
Common Expression Langauge (CEL)
Morf uses a small configuration language designed to enable powerful and type-safe configurations of Workflows, it’s called Common Expression Language (CEL for short).
We use it for many of the core features of the workflow builder, such as:
- Filters: Controlling branching through boolean logic.
- Waits: Defining duration of pauses based on the dates/times in your data.
- Calculated values: Computing calculated values like
first_name + " " + last_name
with simple operators and custom functions.
The syntax should feel familiar to those with experience programming or using scripting languages. This enables us to define an ever-growing library of utility functions and allows us to type-check expressions for safety.
FAQs
What is this crazy filter expression?
e.g. current_step_id.orValue("") == "booking_in_progress"
This is Common Expression Language, which is the language we use to create conditional logic for a workflows. This example is checking to see if the current_step_id
value on a Formsort Step Completed
event is equal to the string “booking_in_progress.” The .orValue("")
accounts for if current_step_id
is not present on the event. More info on CEL here.
CEL can also be used to create calculated values, e.g. date_of_birth.getAge(morf.now())
will return the number of years between date_of_birth
and now.