FlowRelay FlowRelay Docs Shopify Flow Search /
All docs pages

START

USE CASES

SET UP

OPERATE

RECOVER

AGENT ACCESS

REFERENCE

Setup

Trigger variants and event mapping

Use this reference when an operator or authorized agent needs to choose the right Shopify Flow trigger variant and map sender payload fields without guessing.

On this page
Next step Continue with Add the Shopify Flow trigger.

Custom business data #

Select fields or use JSONata, then use typed outputs in Shopify Flow.

Pass custom business data to Flow #

Open Endpoint setup, enable custom business data, and select incoming fields. Give each output a name and a declared type. For example, map customer.email to buyerEmail (Text) and order.total to orderTotal (Number). Dotted paths and numeric array indexes are supported. Types are explicit: a string containing digits becomes a number only when you enable scalar conversion.

Missing output values fail unless you provide a default. A default applies to a missing value, not to an explicit null; accepting null requires a nullable declaration. Lists and nested objects use a declared JSON type; undeclared output keys are rejected. Keep at most 20 top-level outputs and three nested type levels. Integers must fit a signed 32-bit value for Shopify's output schema.

Paste a synthetic JSON sample and choose Preview output. This shows validation, mapped output, and the final serialized Flow payload size without saving the sample, creating an event, or running a workflow. Choose Review settings change, inspect the exact change, then confirm to save.

Expand Build the Shopify Flow workflow. Select the matching trigger and filter FlowRelay endpoint ID to this endpoint's ID. Add Run code, use Shopify's variable picker to select Custom data JSON (customDataJson) without a query alias, and copy the generated JavaScript and output schema. Use its typed outputs in conditions and actions. The endpoint ID stays stable when the display name changes. Manual instructions are complete; the optional Sidekick prompt is a convenience, not proof that a workflow was created.

After saving and configuring Flow, use Send test event on the endpoint. Paste the same synthetic JSON into its optional sample field. This creates a real event and can execute your enabled workflow; unlike preview, normal live-test accounting and retention apply. For native-reference triggers, supply a real development-store resource ID. FlowRelay replaces event identity, time, and the native test ID so repeated test clicks remain distinct.

Custom data is a JSON string in the trigger, not dynamically registered Shopify trigger fields. Native order/customer/product references continue to use their existing mapping and optional permissions. The original trigger fields remain available.

Synthetic incoming message
{"event":{"id":"sample-001","type":"order.review"},"customer":{"email":"buyer@example.com"},"order":{"total":42.5}}
List of text values: declared type
{"type":"array","items":{"type":"string"}}
Nested object: declared type
{"type":"object","properties":[{"name":"email","schema":{"type":"string"}},{"name":"total","schema":{"type":"number"}}]}

Choose the trigger #

Match the Shopify Flow workflow to the narrowest useful trigger variant.

Decision rule #

Pick the narrowest variant that matches what Shopify Flow needs. If the workflow only needs a custom event, start with Generic. If it needs a native Shopify object, use the native resource variant. If it needs one of FlowRelay's related-resource operations, use the related-resource variant.

Workflow needChooseRequired mapping
A custom external event starts the workflow.External eventNo resource identifier path.
Shopify Flow needs a native order, customer, or product reference.External order event, External customer event, or External product eventResource ID path.
The event belongs to inventory, fulfillment, return/refund, or company/B2B operations.The matching operational trigger variantRelated resource ID path.

Trigger variants #

These are the only Shopify Flow trigger variants in the current edition. Agents should use the API value when calling Agent Operations. Operators see the label in the embedded app and in Shopify Flow setup.

Operator labelAPI valueUse whenIdentifier fieldFlow context
External eventgenericThe workflow only needs a custom external event.NoneNo Shopify resource identifier is shown.
External order eventorderThe sender event is about a specific Shopify order.Resource ID pathNative order reference.
External customer eventcustomerThe sender event is about a specific Shopify customer.Resource ID pathNative customer reference.
External product eventproductThe sender event is about a specific Shopify product.Resource ID pathNative product reference.
External inventory eventinventoryThe workflow belongs to inventory operations.Related resource ID pathRelated resource type and text identifier context.
External fulfillment eventfulfillmentThe workflow belongs to fulfillment operations.Related resource ID pathRelated resource type and text identifier context.
External return/refund eventreturn_refundThe workflow belongs to return/refund operations.Related resource ID pathRelated resource type and text identifier context.
External company/B2B eventcompany_b2bThe workflow belongs to company/B2B operations.Related resource ID pathRelated resource type and text identifier context.

Map the event #

Set the resource path, related-resource path, and payload fields the trigger needs.

Mapping fields #

Event mapping tells FlowRelay how to read the sender payload before the Shopify Flow handoff. It does not rewrite the payload, fetch missing data, or transform values.

FlowRelay Create endpoint screen with Advanced authentication and mapping open, showing event type, JSON paths, Shopify resource ID path, and required payload fields.
The common path stays collapsed on Create. Open Advanced authentication and mapping when the sender needs custom event paths, identifiers, or payload requirements.
FieldRequired whenWhat it controlsExample
Default event type / defaultEventTypeAlwaysFallback event type when Event type path is blank or not present in the payload.warehouse.shipment.updated
Event type path / eventTypePathOptionalJSON path where FlowRelay can read the sender's event type from the payload.event.type
External event ID path / externalEventIdPathOptional, recommended when the sender has stable IDsJSON path for the sender's stable event ID, used for correlation and duplicate handling.event.id
Occurred-at path / occurredAtPathOptionalJSON path for the sender's original event timestamp.event.occurred_at
Summary path / summaryPathOptionalJSON path for a short human-readable summary that helps receipts and operators scan events.event.summary
Resource ID path / resourceIdPathOrder, Customer, or Product variantsJSON path for the Shopify ID or GID of the native order, customer, or product.order.id
Related resource ID path / relatedResourceIdPathInventory, Fulfillment, Return/refund, or Company/B2B variantsJSON path for the related resource identifier shown as text context in Flow.fulfillment.id
Required payload paths / requiredPayloadPathsOptional, up to five pathsValidation gates for fields the sender must always include before FlowRelay hands the event to Shopify Flow.items[0].sku

Path syntax #

Use simple dot notation with optional zero-based array indexes. Paths must point to fields that already exist in the incoming JSON payload.

SupportedExampleNot supported
Object propertyticket.idWildcards, filters, functions, transforms, or templating.
Array indexitems[0].skuNegative indexes, array searches, or computed paths.
Existing JSON valueorder.admin_graphql_api_idFetching values from Shopify or another system during mapping.

Synthetic examples #

Keep examples synthetic and redacted. Do not paste production event bodies, customer data, endpoint secrets, authentication headers, signatures, Shopify tokens, or copied merchant incidents into docs, prompts, tickets, or screenshots.

Generic endpoint mapping Use when Shopify Flow only needs a custom external event.
{
  "triggerVariant": "generic",
  "defaultEventType": "warehouse.shipment.updated",
  "eventTypePath": "event.type",
  "externalEventIdPath": "event.id",
  "occurredAtPath": "event.occurred_at",
  "summaryPath": "event.summary",
  "resourceIdPath": null,
  "relatedResourceIdPath": null,
  "requiredPayloadPaths": ["event.id", "event.type"]
}
Order endpoint mapping Use when Shopify Flow needs a native order reference.
{
  "triggerVariant": "order",
  "defaultEventType": "warehouse.order.ready",
  "eventTypePath": "event.type",
  "externalEventIdPath": "event.id",
  "occurredAtPath": "event.occurred_at",
  "summaryPath": "event.summary",
  "resourceIdPath": "order.id",
  "relatedResourceIdPath": null,
  "requiredPayloadPaths": ["order.id"]
}
Fulfillment endpoint mapping Use when Shopify Flow needs a fulfillment operations lane with related-resource context.
{
  "triggerVariant": "fulfillment",
  "defaultEventType": "carrier.fulfillment.exception",
  "eventTypePath": "event.type",
  "externalEventIdPath": "event.id",
  "occurredAtPath": "event.occurred_at",
  "summaryPath": "event.summary",
  "resourceIdPath": null,
  "relatedResourceIdPath": "fulfillment.id",
  "requiredPayloadPaths": ["fulfillment.id", "event.type"]
}

Check boundaries and proof #

Confirm data-access limits, agent behavior, and the receipt after a test event.

Data access note #

Order, Customer, and Product variants pass sender-supplied Shopify resource IDs into Shopify Flow as native references. FlowRelay does not fetch missing Order, Customer, or Product data during mapping. Use the permissions page when a buyer, reviewer, operator, or agent asks when the app requests optional Shopify read scopes.

Agent usage #

Authorized agents should read this page before creating or editing endpoints through API, CLI, or MCP. The OpenAPI schema gives exact request shapes; this page gives the product meaning needed to choose the correct variant and identifier path.

SurfaceWhat the agent should do
Agent Operations APIUse the API value in triggerVariant, send null for inactive resource path fields, and preserve idempotency keys for create or edit work.
CLIUse flowrelay-agent create-endpoint --json endpoint.json after reading this page and the OpenAPI schema.
MCPUse search to inspect OpenAPI, read this page for mapping semantics, then execute only allowed Agent Operations routes inside the grant.
Any agent clientIf the correct variant is unclear, ask the operator instead of inventing a native or related-resource mapping.

Receipt check #

After a test event with synthetic data, the receipt should show the selected trigger variant, resolved event type, any required identifier, required-path validation result, and Shopify Flow readiness. Fix mapping before production traffic if the receipt shows a missing path or unexpected identifier.

Handoff boundary

Delivered means FlowRelay handed the trigger to Shopify Flow. It does not mean downstream Shopify Flow branches, app calls, fulfillment changes, emails, or later systems completed.

Local docs search