Advanced Action Output Settings

Advanced settings are available under Output > Advanced settings in an action’s settings when Republish the action output to another channel is enabled.

These settings control how the action output is processed before it is forwarded to a destination channel. In particular, they allow you to transform the output data and to generate individual events from JSON array results. You can also configure a delay before the output is sent.

Screenshot of Output settings such as Transform data and Send event for each

Transform Data

The Transform data setting modifies the action output before it is forwarded to a destination channel.

With Transform data enabled, you can extract data from the input passed to an action or from the result produced by that action. For a Webhook Action, the result refers to the response from the destination.

Check Transform data and configure the following fields:

Field Description
Content-Type Specify the Content-Type of the data to be sent to another channel.
Content Configure the transformation content. The transformed content replaces the original action result.

Extracting a single field from the action result:

Extract only the number of detected persons (${result.person}) from the result of the Simple Object Detection Action.

{
  "person": "${result.person}"
}

Combining input data and action output:

Combine the input data from the channel where the AI Action was added (${payload}) with the response from the AI model (${result.output}).

Combine input data from the channel where the AI Action is configured (${payload}) with the response from the AI model (${result.output}).

{
  "payload": "${payload}",
  "ai_response": "${result.output}"
}

You can extract or compute intermediate data during the Flux App execution. For details on supported expressions, see Use Expressions in Actions.

The payload that can be sent to another channel is limited to 32,768 bytes. If the action output exceeds this limit, use this feature to narrow the output down to the necessary fields.

Delay

The Delay (seconds) setting specifies the number of seconds to wait before the action output is forwarded to the destination channel.

The maximum value for Delay (seconds) is 900 seconds. If Send event for each is checked, Delay (seconds) will be treated as the wait time before the first element is output.

Send Event for Each

The Send event for each setting generates a new event for each element in an action result when that result is a JSON array.

When this setting is enabled, each element in the array is processed as a separate event. These new events start from the channel specified in Output > Destination Channel.

Configure the following field:

Field Description
Interval (seconds) Specify the interval (in seconds) at which each JSON array element is sent as a new event.

If left blank, the default interval is 5 seconds. If the total time required to send all elements exceeds 900 seconds (including the delay), the interval is automatically adjusted to fit within the 900-second limit. In this case, Delay (seconds) remains unchanged.

For example, if Delay (seconds) is set to 100 and Interval (seconds) is set to 1000 for a JSON array with three elements, the behavior is as follows:

Event Elapsed Time from Original Event Description
Event processing JSON array 0 sec The base event processes the JSON array and generates new events for each element.
1st new event 100 sec Processing of the first element begins after the specified delay.
2nd new event 500 sec Executed at an evenly spaced interval between the first and last event.
3rd new event 900 sec Adjusted to fit within the 900-second total limit.

Each new event is counted individually:

  • Each JSON array element is sent as a separate event and counted individually. For example, a JSON array with 10 elements generates 10 events.
  • If generating all events would exceed the event count limit, no new events are generated and no data is sent to the destination channel. For details, see Setting Quotas for Event Count and Credit Usage.
  • You can view the history of generated events in the Execution History tab of Soracom Flux Studio. For more information, see View Execution/Message History (Logs).

The individual events generated from each element display data similar to the following in the context:

{"eventType":"action","actionRunId":"0123456789ABCDEFGHIJKLMNOP"}

If Output > Advanced Settings > Transform data > Content is configured, the transformed result is treated as the action result. If that result is a JSON array, Send event for each generates individual events for each element.