Skip to content

Triggers

A trigger is how work starts for a Workflow. It connects a blueprint pathway to the thing that should start it, and one pathway can have more than one. Every trigger is scoped to one tenant and workspace.

MedFlow has three types:

TypeStarts a run whenBest for
Webyour system POSTs to the trigger’s URLyour own backend, a form, or a job firing it on demand
Searcha query matches a patient or pathwayacting on everyone who meets a clinical condition, on a schedule or as matches appear
Eventan event happens in a connected systemreacting to activity like a new patient, a lab result, or a partner event

You fire a web trigger directly over HTTP. Your backend, a form, or a job POSTs a payload to the trigger’s own URL when something happens in your system, and MedFlow starts a run.

bash
curl -X POST "https://api-staging.medflow.care/v1/triggers/TRIGGER_ID" \
  -H "Authorization: Bearer $MEDFLOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "payload": {} }'

This is the most direct option when your own system already knows a run should start. See the Quickstart for the full walkthrough and Runs for what comes back.

A search trigger runs a query against your data and starts a pathway for each patient or pathway that matches. Use it to act on an entire patient cohort that meets a clinical condition, rather than one record at a time.

A search trigger can rerun its query on a fixed schedule, for example nightly or hourly, so new matches are picked up without anyone starting a run by hand. Leave the schedule off to run it on demand.

Search depends on current data, so data sources and data syncs keep the clinical graph in sync and the query sees the latest matches.

An event trigger starts a pathway when MedFlow raises an event, such as a new patient, a new lab result, or a completed appointment. You pick the event from the Connections catalog and bind it to a pathway. MedFlow owns the event: it raises the event from what it observes. External systems do not directly trigger runs from events, instead use a web trigger.

MedFlow raises an event from the data and activity it sees:

  • New data arriving from a connected system, whether pushed in through an inbound webhook or pulled in by a data sync.
  • Changes its own integrations detect while keeping the clinical picture in sync.

Every trigger has shared fields plus options that depend on type (web, search, or event). Full shapes: Triggers API.

FieldRole
typeweb, search, or event
sourceIdBlueprint pathway to run
autoStartStart node actions as soon as a run is created
activeWhether the trigger is enabled
queryIdSearch only: query that selects who to start pathways for
scheduleSearch only: optional recurring cadence
eventEvent only: event type to match (for example order.signed)

Manage triggers in the product or through the Triggers API. Partner API keys and a test workflow (web, search, or event, depending on what you need) are set up when you request access. See Authentication and Quickstart.

NeedUse
Your system has a payload and a known trigger idWeb trigger
Start a pathway for every record a query matchesSearch trigger
Rerun a query on a schedule, for example nightlySearch trigger with a schedule
React to a change MedFlow sees, like a new patient or lab resultEvent trigger
A partner pushes data to a fixed URLInbound webhook; MedFlow can raise an event trigger from it