Merge Step

Rejoins values from multiple incoming workflow branches into a single set of output fields. Use this step after a Logic step (or other branching) so downstream steps can read one mapped value per field regardless of which branch ran. At runtime, each field takes the first non-empty source.

The Merge step brings values from separate workflow paths back into one set of fields. Add it after a Logic step when multiple paths continue into the same downstream steps.

Merge cannot be the first step in a workflow. It must have at least one incoming connection. Use type: "merge" on the containing workflow step.

Before you begin

For each output field:

  • Generate a UUID for the field.
  • Choose the output data type.
  • Add one mapped source from each workflow path that can supply the value.
  • Put the sources in the order in which Merge should check them.

A merge field can use at most one source from each incoming path. Mapping placeholders use the source step's exact description and field identifier.

Configuration

nametyperequiredconstraintsdescription
mergeableNamestringyesName shown for the merged output.
fieldsarrayyesitems: merge fieldOrdered fields made available to later steps.

Merge field

nametyperequiredconstraintsdescription
idstringyesUUIDField identifier used by mappings in later steps.
labelstringyesName shown for the field.
typestringyesSee Field types.Data type produced by the field.
sourcesarrayyesitems: mapping placeholder or valueValues checked in order; the first non-empty value is returned.

Field types

The type property accepts:

  • string, number, boolean, date, or file for one value.
  • array<string>, array<number>, array<boolean>, array<date>, or array<file> for a list of values.

Connect workflow paths

When you create or update a project, place the Merge step after the final step on each incoming path. Use those step descriptions in edges[].prev.

The example below joins paths ending at Premium form and Standard form, then continues to Notify customer:

{
  "description": "Merge customer data",
  "type": "merge",
  "config": {
    "mergeableName": "Customer",
    "fields": [
      {
        "id": "3f1c9a2e-8b44-4d1a-9c7e-1a2b3c4d5e6f",
        "label": "Customer name",
        "type": "string",
        "sources": [
          "{{`Premium form`.`fullName`}}",
          "{{`Standard form`.`fullName`}}"
        ]
      }
    ]
  },
  "edges": [
    {
      "prev": "Premium form"
    },
    {
      "prev": "Standard form"
    },
    {
      "next": "Notify customer"
    }
  ]
}

Include this complete step object in the workflow.steps array sent through the project create or update endpoint.

Runtime behavior

Merge checks sources in array order and returns the first non-empty value. Empty strings, null, and empty lists are skipped. Numbers, booleans, files, and non-empty lists count as values.

Values are converted to the configured output type when supported. For example, a numeric string can supply a number field, and an array containing one file can supply a file field. The step fails when a value cannot be converted.

Examples

Minimal configuration

This configuration creates one output field from two possible workflow paths:

{
  "mergeableName": "Customer",
  "fields": [
    {
      "id": "3f1c9a2e-8b44-4d1a-9c7e-1a2b3c4d5e6f",
      "label": "Customer name",
      "type": "string",
      "sources": [
        "{{`Premium form`.`fullName`}}",
        "{{`Standard form`.`fullName`}}"
      ]
    }
  ]
}

If the premium path supplies "Alice", the merged Customer name is "Alice". If that value is empty, Merge checks the standard path.

Multiple field types

This example merges a number, file, and list:

{
  "mergeableName": "Customer",
  "fields": [
    {
      "id": "a11c9a2e-8b44-4d1a-9c7e-1a2b3c4d5e6f",
      "label": "Amount",
      "type": "number",
      "sources": [
        "{{`High-value path`.`credit`}}",
        "{{`Standard path`.`credit`}}"
      ]
    },
    {
      "id": "b22c9a2e-8b44-4d1a-9c7e-1a2b3c4d5e6f",
      "label": "Signed file",
      "type": "file",
      "sources": [
        "{{`High-value path`.`contract`}}",
        "{{`Standard path`.`contract`}}"
      ]
    },
    {
      "id": "c33c9a2e-8b44-4d1a-9c7e-1a2b3c4d5e6f",
      "label": "Tags",
      "type": "array<string>",
      "sources": ["{{`High-value path`.`tags`}}", "{{`Standard path`.`tags`}}"]
    }
  ]
}

Limitations and common errors

  • Merge is the first step. Add at least one earlier step and connect it through edges[].prev.
  • A mapping is rejected. Confirm that its step description and field identifier match an earlier step on the same workflow path.
  • A field has multiple sources from one path. Keep no more than one source for that field from each incoming path.
  • A value cannot be converted. Choose an output type compatible with the source value.
  • An ID is rejected. Generate a valid UUID for every merge field.

Did this page help you?