Advanced Action Output Settings

Advanced settings can be applied to any action in a Flux app.

The Output > Advanced settings section in an action allows you to change the format of data sent to another channel or generate new individual events from each element if the action result is a JSON array.

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

Transform Data

You can transform the action result (in the case of a Webhook action, this refers to the response from the destination). During transformation, you can extract necessary data from Input to the action or Result of the action.

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. This result will be treated as the action result.

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

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

Example (1-2): Treat the following two data items as the action result:

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

You can extract or compute intermediate data during the Flux App execution. For more details on usable expressions, see Action and Condition Syntax.

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

Delay (seconds)

Specify the number of seconds to wait before starting to output data to another 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

When the action result is a JSON array, you can generate a new individual event for each element. These new events will start from the channel specified in Output > Destination Channel.

Check Send event for each and configure the following fields:

Field Description
Interval (seconds) Specify the interval (in seconds) to send each JSON array element as a new event.

If left blank, the default interval is 5 seconds. If the total time to send all elements exceeds 900 seconds (including the delay), the interval will be adjusted to fit within 900 seconds. In this case, Delay (seconds) will remain unchanged.

For example, if Delay (seconds) is set to "100", and Interval (seconds) is set to "1000" for a JSON array with 3 elements, the behavior will be:

Event Elapsed Time from Original Event Description
Event processing JSON array 0 sec The base event that processes the JSON array and generates new events for each element.
1st new event 100 sec Starts processing the first element 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 new event and individually counted. For example, if the JSON array has 10 elements, 10 events are added.
  • If executing all the split elements exceeds the event count limit, no data will be sent to the other channel (no new events will be generated). See Set Limits on Event Counts and Credit Usage for details.
  • You can view the history of new events in the Execution History tab of Soracom Flux Studio. For more details, see View Execution/Message History (Logs).

The individual events for each element will display data similar to the following in the context:

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

If Output > Advanced Settings > Transform data > Content is set, the result is treated as the action result. Therefore, if you convert the action result into a JSON array in Content, new individual events can be generated for each element.