Build and run a flow in Inferrex
A flow moves or changes data. In InferrexAPI paths and InferrexMCP tool names a flow is called a pipeline. They are the same thing. Say "flow" to the user.
A new flow is a draft. Nothing syncs until it is turned on. Always dry run before turning on a flow that writes to a system.
When to use
- "Sync orders from the shop into finance."
- "Run that flow now." / "Run it every weekday morning."
- "Add the warehouse as another destination."
- "Promote this flow to Production."
If the flow is failing, use inferrex-diagnose-flow.
Prerequisites
- InferrexMCP at
https://mcp.inferrex.com/mcp(sign-in or API key in a header), or InferrexAPI athttps://api.inferrex.comwithX-API-Key: $INFERREX_API_KEY. - Key scopes:
pipelines:read,pipelines:write,connections:read,mappings:read,jobs:read,workspace:read. - The source system is approved. For a flow between two systems, an approved mapping joins them (
inferrex-map-systems).
Steps: build
- Confirm the environment. Call
workspace_get_active_environment. Tell the user thenameandclass. A flow belongs to the environment it is created in. If the class isproduction, say so plainly and ask the user to confirm before any write. - Find the parts. Call
connection_listfor the system ids. For a flow between two systems, callmappings_listand pick the mapping that joins them (source_connection_id,target_connection_id). If the user has not approved it yet, stop and useinferrex-map-systems. - Check for an existing flow. Call
pipeline_listwithconnection_idset to the source system. If a flow already does this, ask whether to use it. - Create the draft. Call
pipeline_createwithname,sourceConnectionId, and, for a flow into another system,targetConnectionIdandmappingManifestId. LeavetargetConnectionIdout for a flow whose only destination is the Golden record. The flow starts asdraft. - Dry run. Call
pipeline_dry_runwithid. Keep thejobId. - Read the result. Call
jobs_get_jobuntilstatusissucceeded,failedorcancelled. On success, readresult.preview:recordsRead,- for each destination:
wouldWrite,held(records that would not be sent) andsamples, each withsource(as read) andconverted(what would be sent).
- Show the user. Give the counts and one or two samples per destination, source beside converted. If
heldis not zero, say so. IfwouldWriteis zero, say nothing would be written and stop. - Turn it on, only when the user says so. Call
pipeline_activate. A first full sync starts at once. Keep thejobIdand follow it withjobs_get_job. - Confirm the first sync. Call
pipeline_history. Report records read, written, skipped and failed for the latest run.
Steps: run and schedule
- Sync now:
pipeline_syncwithidandsyncType:incremental(default, only what changed),fullorinitial. The flow must be active. Ask before afullsync. - Schedule:
pipelines_set_pipeline_schedulewithscheduleType:realtime,scheduled,after_sync,manualorsystem. Forscheduled, sendscheduleCronandscheduleTimezone. Read the cron expression back to the user in words before you save it. - Pause:
pipelines_pause_pipeline. Turn back on:pipeline_activate. - Stop a running sync or dry run:
jobs_cancel_job. A run that is already writing records finishes. - Move a flow to a newer mapping version:
pipelines_apply_mapping_to_pipelinewithmappingVersionId, the version the user reviewed. It is refused if the mapping changed since.
Steps: change destinations
- Draft:
pipelines_create_flow_changewithid,kind(add-destinationorremove-destination),connectionId, andmappingIdwhen adding. - Show the user the answer's
riskLevelandpreview(destinationsBefore,destinationsAfter). Nothing is applied yet. - On a yes:
pipelines_confirm_flow_change. The answer says whether it applied or now waits for approval. - On a no:
pipelines_discard_flow_change.
Steps: promote to another environment
- Call
workspace_environments_listand confirm the target with the user by name and class. - Call
pipelines_get_promotion_approval_ladderand tell the user who must approve for that target. - On a yes:
pipelines_promote_pipelinewithidandtoEnvironmentId. - Report
status,riskLevel,changeCountandpolicyDecision. If it is refused because a system is not set up in the target environment, say which, and stop.
Checks before any write
- Dry run before
pipeline_activate, every time, and show the result. - Get an explicit yes before
pipeline_activate, afullsync, a confirm of a flow change, or a promotion. - Never promote into
productionwithout the user naming Production themselves.
Equivalents
| Step | InferrexMCP tool | InferrexAPI |
|---|---|---|
| Environment | workspace_get_active_environment |
GET /v1/workspace/environment |
| List flows | pipeline_list |
GET /v1/pipelines |
| Create | pipeline_create |
POST /v1/pipelines |
| Read one | pipeline_status |
GET /v1/pipelines/:id |
| Dry run | pipeline_dry_run |
POST /v1/pipelines/:id/dry-run |
| Job | jobs_get_job |
GET /v1/jobs/:id |
| Cancel job | jobs_cancel_job |
POST /v1/jobs/:id/cancel |
| Turn on | pipeline_activate |
POST /v1/pipelines/:id/activate |
| Sync now | pipeline_sync |
POST /v1/pipelines/:id/sync |
| Runs | pipeline_history |
GET /v1/pipelines/:id/history |
| Schedule | pipelines_set_pipeline_schedule |
PUT /v1/pipelines/:id/schedule |
| Pause | pipelines_pause_pipeline |
POST /v1/pipelines/:id/pause |
| Apply mapping | pipelines_apply_mapping_to_pipeline |
POST /v1/pipelines/:id/apply-mapping |
| Draft a destination change | pipelines_create_flow_change |
POST /v1/pipelines/:id/changes |
| Confirm it | pipelines_confirm_flow_change |
POST /v1/pipelines/:id/changes/:changeId/confirm |
| Discard it | pipelines_discard_flow_change |
POST /v1/pipelines/:id/changes/:changeId/discard |
| Approval ladder | pipelines_get_promotion_approval_ladder |
GET /v1/pipeline-promotions/approval-ladder |
| Promote | pipelines_promote_pipeline |
POST /v1/pipelines/:id/promote |
Report back
- The flow's name, id,
statusand environment. - The dry-run counts and whether anything was held.
- After turning on: the first sync's job
statusand record counts. - Anything now waiting for another person's approval, and who must approve.
Never
- Never turn on a flow without a dry run the user has seen.
- Never approve your own flow change or promotion. Where approvers are required, another member must approve.
- Never archive a flow (
pipelines_archive_pipeline) unless the user asks for exactly that. - Never change a flow's direction to
reverseorbidirectionalwithout the user asking. It makes the flow write to its source system. - Never describe a flow as working because it was created or turned on. Report the result of a run.