Skip to content
Reference

Components

Steps saved once and reused in any workflow at a pinned release, what a Component step runs, its inputs and outputs, tests, releases and Used by.

On this page

A component is a group of steps saved once and reused in any workflow, for example "parse an SIU, map it, post the appointment row". A workflow uses it through a Component step that pins one of its releases. The component's steps run inside the workflow's own run, so each of them shows in the run's steps.

Save steps as a component

In the designer, choose Save as component:

  • In the Steps view, on the header of the Source transformer or of a destination's steps. Pick a run of steps in one list. A destination's send, a filter and a fetch stay in the workflow.
  • In the Graph view, on the test panel (Save steps as component). Pick any connected steps.

A pick follows the same rules as Run with sample: one step, or steps that follow on from one step, and not both branches of a filter. It must also end in one step with one way on: not a filter or condition, parallel or loop step (a Component step has one way out, so their branches would be lost). Add the steps after it to the pick, or end the pick before it. It can't take the workflow's first step or the router.

SettingWhat it does
NameWhat the component is called in step lists, runs and Used by.
DescriptionOne sentence on what it does.
What it needs and gives backThe inputs and outputs (see below). Filled in from the picked steps' data maps, then yours to change.
Use the component here, in place of these stepsOn by default: the picked steps become one Component step pinned to 1.0.0. Save the workflow to keep the change.

Saving creates the component and releases it as 1.0.0 at once, so any workflow can use it straight away.

No secret is copied. A component is shared, so a step with a secret typed into its settings is refused, with the step named. That is checked when the component is saved, on every later save of its steps, and again on every release. A secret is:

  • a password, token, key or other secret-named setting with a value typed in;
  • any header value other than plain ones such as Content-Type or Accept, in a header map or a list of name and value pairs;
  • a URL with a password or a key in its query (https://user:pass@…, ?api_key=…);
  • a JavaScript step that sets a secret-named variable or field to text (const apiKey = "…") or a Bearer / Basic value.

Connections (adapter profiles) and workspace secrets ({{env.NAME}}) are kept as references: each workflow that runs the component uses the connection the step names, and the secret stays where it is.

The Component step

In the Steps view, choose + Use a component in the source transformer or a destination's steps. In the Graph view, Component is in the step palette.

SettingWhat it doesDefault
ComponentThe component to run, in this workspace.
ReleaseThe release it runs, for example 1.0.0. Always a release, never a draft.The newest release when you pick it
It expectsThe component's inputs (read only).
It returnsThe component's outputs (read only).
Different connection per senderWhen the release sends: a connection per sender for its send steps. See Per-sender connections.The component's own connection

The step stays pinned. Editing the component, or releasing it again, changes nothing for the step until you pick another release. When a newer release exists, the step says so. A release is always a number like 1.0.0: latest, or any other label, is refused by validation and at run time, so a new release never changes a workflow on its own.

How it runs

When a run starts, each Component step is replaced by the component's steps at the pinned release:

  1. Inputs check (<step> › inputs): the message must match the component's inputs. A missing required input, or one of the wrong type, fails the step before any of the component's steps runs.
  2. The component's own steps, each shown as <step> › <component step>, in the run's Steps tab, its trace and Run with sample.
  3. Outputs check (the step itself): the last step's result must match the outputs, and only the declared outputs go on. With no outputs declared, the last step's whole result goes on.

Everything runs inside the calling run: same workspace, same sender, same retries, same ordering. Nothing is queued. A step error path on the Component step also catches a failure of any step inside the component. Components can contain components, up to five deep. A component can't contain itself, directly or through others: saving or releasing one that would is refused, naming the loop.

A release's steps are read once per engine process and then kept in memory (a release never changes). The component and its release labels are still checked on every run, so a deleted component stops at once.

A component that was deleted, or a release that doesn't exist, fails the step with the reason.

Inputs and outputs

The same form as a callable workflow's: each field has a name, a type (text, number, whole number, yes / no, record, list) and whether it is required. When you save steps as a component, the guess is:

  • Inputs: the first step's data map sources, by top-level field. A component that starts by reading an HL7 message takes the message as it is, so no inputs are guessed.
  • Outputs: the last step's data map targets, by top-level field.

Edit them on the component's page (What it needs and gives back, then Save to draft).

The component's page

Workflows, ··· › Components, then a component. It shows:

SectionWhat it holds
StepsThe draft's steps, in order. Edit steps opens them in the designer, marked Component, with Back to component. There is no Run now, On or Deploy there: a component never runs on its own.
What it needs and gives backThe draft's inputs and outputs.
TestsIts saved tests. Add a test runs a sample through its steps (Run with sample) and saves the run; Run tests runs every one.
ReleasesEvery release, newest first, with what changed.
Used byEach workflow, and each component that contains it (marked Component), with the release it pins: Running for a workflow's deployed version, Released for a component's release, Draft for a change not yet deployed or released. A pin behind the newest release says so.

Editing and releases

Editing the steps or the inputs and outputs saves a draft (a new version). Workflows keep the release they pin. Publish release… then:

  1. runs the component's tests on the draft; a failing test holds the release back;
  2. labels the draft with the next release (semver, higher than every earlier one);
  3. offers it to workflows, which still run their pinned release until each one is updated: the release's impact lists them, runs their tests against it and updates the ones that pass to new drafts (see Release impact and updates).

A release labels one version for good: editing the component again never changes what a release runs.

A component that workflows or other components use can't be deleted. Remove its steps from them first.

A workflow promoted to another workspace takes its components with it, and a component can be promoted on its own from its page (Promote…, admins). It lands there as a draft: release it there. See Environments and promotion.

A component is released and deleted only from its own page. The workflow routes refuse it with 409 and code COMPONENT: delete, turn on, deploy, roll back and cut a release (DELETE and PATCH /api/workflows/{id}, /deploy, /rollback, /versions/{version}/rollback, POST /releases).

Audit

EventWhen
component.createdSteps were saved as a component.
component.updatedIts draft was saved (steps, inputs or outputs).
component.releasedA release was made (the first one, 1.0.0, included).
component.deletedIt was deleted.
component.updateWorkflows were updated to one of its releases.

A release's test run is also recorded as workflow.test_cases_run.

API

Method and pathWhat it does
GET /api/componentsThe workspace's components, their releases and Used by counts.
POST /api/componentsSave picked steps of a workflow graph as a component (1.0.0).
GET /api/components/{id}One component: steps, contract, releases and Used by.
POST /api/components/{id}/releasesRelease the draft ({ "label": "1.1.0", "notes": "..." }).
DELETE /api/components/{id}Delete a component no workflow or component uses.

The component's steps, versions and tests use the workflow endpoints with the component's id (PUT /api/workflows/{id}, /api/workflows/{id}/test-cases, /api/workflows/{id}/test-steps). See the API reference.