Skip to main content
The profile lookup is the join between an incoming event, the workflow execution and a Morf profile. It determines which profile the workflow is running for, and it’s what makes downstream steps — reading profile properties, writing updates, sending to destinations — easy. Without a successful lookup, the workflow has no profile to act on.

Lookup sequence

You can configure one or more lookups in sequence. When a workflow executes, Morf tries each lookup in order and stops as soon as it finds a matching profile. Multiple lookups are useful when the identifying field may not always be present — for example, a new patient may not yet have an EHR ID in Morf, so you fall back to email address. Each lookup specifies:
  • A field on the event payload — the value Morf will use to search (a CEL expression referencing the payload)
  • A profile identifier type — what that value maps to on the Morf profile (e.g. Healthie patient ID, email address, phone number)
Recommended: use the EHR’s patient ID as your primary lookup for EHR-triggered workflows. The EHR ID is guaranteed to be on the payload and uniquely identifies the profile. Email and phone are better suited as fallbacks or for workflows that may run before the EHR ID exists in Morf.

Example: multi-step fallback

An intake form submission triggers a workflow. The lookup sequence is:
  1. Try healthie_patient_id — Skip to next lookup if the field is missing
  2. Try email_address — Error if the field is missing
New patients are matched by email; returning patients are matched by their Healthie ID. Once either lookup finds a profile, the sequence stops.

If the lookup field is missing

For each lookup, choose what happens if the specified field is not present on the payload:
  • Error — the event does not proceed through the workflow and appears as an error in the monitoring page
  • Skip to next lookup — moves to the next lookup in the sequence
  • Continue with execution — shown on the last lookup in the sequence; falls through to the “if no profile is found” action below
  • Stop workflow — the event does not proceed through the workflow and appears as a completed execution in the monitoring page
If the last lookup in your sequence is set to Continue with execution and the lookup field is missing from the payload, execution falls through to the “if no profile is found” action. If that action is Create Lead or Create Patient, Morf will create a profile — but because the identifying field was missing, the new profile may not be reachable by future lookups. Use Stop workflow or Error on your last lookup if you want to avoid creating unreachable profiles.

If no profile is found

If all lookups are exhausted without finding a match, choose how the workflow proceeds:
  • Retry — retry the lookup up to 10 times (useful when a profile may not yet exist but is expected to)
  • Create Lead — create a new lead profile and continue the workflow
  • Create Patient — create a new patient profile and continue the workflow
  • Error — the event does not proceed through the workflow and appears as an error in the monitoring page
  • Stop workflow — the event does not proceed through the workflow and appears as a completed execution in the monitoring page
Could this be the first time Morf receives data for this profile? Will the profile already have the application ID, or should contact info be used to perform the lookup?
  • e.g. A new contact is created in your CRM, triggering a workflow in Morf. Since this event is the first time the CRM contact ID will be in Morf’s system, the profile lookup should be done using email or phone number.
Will this workflow only ever execute for patients, leads, or both?
  • e.g. An appointment-triggered workflow may only ever be triggered by patients. However, if it’s an initial appointment, the profile may be a lead. In this case, your workflow should allow for both patients and leads.