Add To Response (Fixed)

Overview

Add To Response (Fixed) adds key-value pairs to the flow response. The value is evaluated when the stage runs and is then stored as a fixed value in the response. Any later changes to the original variable are not reflected in that response field.

Use this stage to return status information, metadata, calculated results, or a snapshot of a variable at a specific point in the flow.

* This example demonstrates how Add To Response (Fixed) captures the value of a variable when the stage executes. Although counter changes later in the flow, the response keeps the original captured value (count = 0).

Note: The variable names, values, criteria, and configuration used in this example are for demonstration purposes only.

Configuration

Required Fields

FieldDescriptionExample
Name (Response Key)The key that will appear in the response. Enter it as plain text without variable brackets.

status

userId

totalAmount

Value (Response Value)The value assigned to the response key. This can be static text, a number, a variable reference, or a formula.

success

{{userId}}

=({{price}}*1.1)

Value Types

Value TypeHow It Is HandledExample
Static TextThe text is added to the response exactly as entered.

success

completed

NumberThe numeric value is added to the response.

42

99.99

Variable ReferenceThe variable is resolved when the stage executes, and the resolved value is stored in the response.

{{userId}}

{{timestamp}}

Formula ExpressionThe formula is evaluated when the stage executes, and the result is stored in the response.

=({{price}}*1.1)

=({{total}}/{{count}})

Exit Points

ExitWhen It Is Used
PassThe stage completes and continues to the next connected stage.

How It Works

When the stage executes, it:

  1. Processes each configured key-value pair and reads the Name and Value fields.
  2. Resolves the value by using the entered text, variable reference, number, or formula.
  3. Stores the resolved result as a fixed value in the response.
  4. Continues through the Pass exit to the next connected stage.

Key behavior: The stage stores a snapshot of the value at the moment it runs. If the source variable changes later in the flow, the response field created by this stage keeps the earlier value.

Common Use Cases

1. Add Status and Metadata

Add standard information that should be included in the final response.

Configuration:

  • statussuccess
  • timestamp{{@timestamp}}
  • version1.0
  • userId{{userId}}

Example response:

{  "status": "success",  "timestamp": 1704067200000,  "version": "1.0",  "userId": "user_123" }

2. Add Calculated Values

Evaluate formulas and include their results in the response.

Configuration:

  • totalAmount{{amount}}
  • taxAmount=({{amount}}*0.1)
  • netAmount=({{amount}}*0.9)
  • processedtrue

Example response:

{  "totalAmount": 100,  "taxAmount": 10,  "netAmount": 90,  "processed": true }

3. Build a Response Across Multiple Stages

Use more than one Add To Response stage to add fields at different points in the flow.

Stage 1:

  • resultsuccess
  • processedAt{{timestamp}}

Stage 2:

  • itemCount{{count}}
  • averagePrice=({{total}}/{{count}})

Result: The final response contains the fields added by both stages.

4. Add Branch-Specific Response Fields

Use Route Flow first, then configure a different Add To Response stage on each branch.

Pass branch:

  • statuscompleted
  • duration{{elapsed}}
  • successtrue

Fail branch:

  • statusfailed
  • error{{errorMessage}}

Key Behaviors

FeatureBehavior
Fixed SnapshotThe resolved value is stored when the stage executes and does not update later.
Multiple StagesMultiple stages can add fields to the same response.
Variable Resolution{{variable}} is resolved from the flow dictionary when the stage runs.
Formula SupportA formula beginning with = is evaluated before its result is added.
Response BuildingThe stage adds configured fields without removing unrelated response fields.
Single ExitThe stage continues through the Pass exit.

Best Practices

  • ✓ Use clear and consistent response key names.
  • ✓ Use plain text for Name fields and variable references only in Value fields.
  • ✓ Place the stage after the values it depends on have been created or calculated.
  • ✓ Use formulas when the response needs a calculated value.
  • ✓ Use unique key names unless you intentionally want to replace an existing response value.
  • ✓ Use Add To Response (Dynamic) when the response must reflect later changes to a variable.
  • ✓ Test the final response to confirm the expected values and data types.

Common Mistakes

MistakeSymptomFix
Using variable brackets in the Name fieldThe response key is not created as expected.Enter the key as plain text, for example userId.
Forgetting the formula prefixThe formula is treated as text instead of being evaluated.

Add the formula prefix before the expression:

=({{price}}*{{quantity}})

Referencing a missing variableThe response contains an empty or unexpected value.Create or initialize the variable before this stage runs.
Using the same response key more than onceA later value replaces an earlier value for that key.Use unique key names unless replacement is intentional.
Expecting the value to update laterThe response contains the value captured earlier in the flow.Use Add To Response (Dynamic) when the latest variable value is required.

Troubleshooting

IssueCommon CauseFix
Field is missing from the responseThe stage was not executed, or the Name field is empty.Confirm that the stage is connected to the active execution path and that the Name field is completed.
Variable value is emptyThe variable does not exist when the stage runs.Initialize it earlier with Set Default Value or create it in a preceding stage.
Formula is returned as textThe formula does not begin with the required prefix.Add = before the formula.
Response contains an older valueThe variable changed after Add To Response (Fixed) executed.Move the stage after the final variable update or use Add To Response (Dynamic).
A response value was replacedThe same response key was added again later.Review the response key names used in all Add To Response stages.

Do's and Don'ts

Do:

  • ✓ Use this stage to capture a value at a specific point in the flow.
  • ✓ Enter response keys as plain text.
  • ✓ Use variable references such as {{userId}} in the Value field.
  • ✓ Use formulas such as =({{total}}*0.1) for calculated results.
  • ✓ Confirm that required variables exist before the stage executes.

Don't:

  • ✗ Do not use variable brackets in the Name field.
  • ✗ Do not forget the = prefix for formulas.
  • ✗ Do not expect a fixed response value to change after the stage has executed.
  • ✗ Do not reuse a response key unless replacing its previous value is intentional.
  • ✗ Do not place the stage before the variables or calculations it requires.

Edge Cases

  • Variable changes later: The response keeps the value captured when the stage executed.
  • Duplicate response keys: A later value using the same key may replace the earlier value.
  • Missing variable: The response may contain an empty or null value, depending on the available data.
  • Empty static value: An empty value may still be included in the response.
  • Formula error: Review the formula syntax and confirm that every referenced variable exists.

Related Stages