For the complete documentation index, see llms.txt. This page is also available as Markdown.

Event Step

Event steps pass event payload to an event handler, to execute selected action with given parameters.

Event Step Definition
Event Step Definition

Dragging and dropping an event step from the icon bar of a saga adds a new step. It is possible to configure each step clicking on the edit icon displayed when hovering its node. The following fields are used for overall settings of the step:

  • Name: Descriptive name of the step, which will be displayed on the saga flow.

  • Auto Fail: Whether failure of this step should automatically fail the whole saga flow. If not set to true (or the saga itself has auto fail setting), error status should be handled separately.

  • Continue on Fail: Whether this step should continue despite failing, in case the saga itself is set to "Auto Fail".

  • Description: Verbal description of the step, for reference and documentation.

  • Stroke: Color to use for drawing borders of the step, for visual purposes.

  • Fill: Color to use for filling the step node, for visual purposes.

  • ID: ID of the step used for reference in logs.

Event Step Metadata
Event Step Metadata

The actual functionality of an event step is defined using event metadata settings listed below:

  • Event Handler: Alias of the event handler that should be used for calling a function on the runner receiving this event (e.g. read). This is an optional setting in some cases, as runners can match handlers to events based on streams the requests are received from. However, if the event is being processed locally (e.g. on "local" stream), this setting should be explicitly defined.

  • Event Version*: Numerical version of the action implementation to be used. Handlers allow versioning of their functions (i.e. actions) with new releases, so this setting defines which version should be used for a specific request. This is a mandatory setting, which should be set to 0 for unversioned actions.

  • Event Action*: Name of the function to be called on target event handler (e.g. Get) or alias of the preconfigured action on target runner (e.g. GetProduct). This is a critical setting, as it specifies actual action to execute for the step.

  • Event Domain: Alias of a state, query or a system, which is used as the main target for event action (e.g. "Get" from "product" state). The meaning of this setting depends on the event handler configuration itself.

  • Input Element: Json path for the data input from event payload (e.g. parameters). This parameter allows using events with different formats as input to the same event handler. If no input element is provided, full payload is used as the input.

  • Output Element: Json path for the data output on event payload (e.g. list). This parameter allows outputing to different paths based on output format required by the API endpoint or the next saga step. If an input element is given, output element is relative to that path. If the output element starts with '$.', it is relative to the root of event payload, ignoring input element setting. If the output element is '-', it is ignored and no data is added to event payload as the output.

  • Action Specific Parameters: Based on the "Event Action" selected, a number of additional parameters are displayed dynamicall (such as URL for a Call Rest action).

Event Step Advanced
Event Step Advanced

In addition to action specific parameters, all event steps allow configuration of some additional properties, displayed under ADVANCED tab:

Common Action Parameters

Some actions support the following optional parameter groups. Each action page identifies the groups it supports.

Caching

Parameter
Definition
Example
Default

Use Cache

Whether this event should use the cache

true

false

Cache State

Name of the state manager used for caching event data

product_cache

-

Cache Key Pattern

JMESPath expression that produces the cache key

join([id, version])

-

State access

Parameter
Definition
Example
Default

Skip Access Query

Reads or writes directly, without falling back to the query defined on the state

true

false

Write response form

Parameter
Definition
Example
Default

Form

Form of response to produce. full includes custom data fields.

full

full

Secret key generation

Parameter
Definition
Example
Default

Generated Key Length

Length of the generated key when keyId does not exist in the key state

32

32

  • Common Parameters

    • Fire & Forget: Allows submitting action without waiting for its result. In this scenario the step only returns a reference ID, and returns before any processing happens. Fire-forget steps never fail, and results of the step needs to be monitored from a separate state.

    • Log Detail: Defines whether payload details should be fully logged regardless of the current log level. Recommended on development environments only, since can result in logging sensitive data in some cases.

    • Ignore Errors: Comma separated list of Rierino error codes to ignore (e.g. allowing STALE update errors on write actions).

    • Delay Ms: Milliseconds to wait between executing actions (e.g. for rate limiting on target systems).

    • Delay ID: Unique identifier of the actions which should wait each other with "Delay Ms".

    • Meta Path: Json element path in payload for pulling full event metadata dynamically.

    • Parameters Path: Json element path in payload for pulling parameters dynamically.

  • Iteration Parameters

    • Loop For Each Input: Whether the action will be repeated for each record in input element (should be an array)

    • Loop In Parallel: Whether the loop will be executed in parallel faster using more resources

    • Inner Input Element: Json path for the inner element to use in a for each loop (inside main input element)

    • Inner Output Element: Json path for the inner element to output to in a for each loop (inside main output element)

    • Pass Root From: Section of the event payload to pass as root, instead of replicating full payload on each iteration

    • Pass Root As: Data path to pass root elements to for each loop (defaults to "$root"). Use "-" to exclude root from loops.

    • Pass Index As: Data path to pass index of row to for each loop (defaults to "$index"). Use "-" to exclude root from loops.

    • Return Full Result: Whether iterations should return full payload or only the output element values

  • Full Parameter Map: Includes a table of all parameters configured.

  • Response Stream

    • Deployments: List of runner deployment ids which are allowed to execute this step. This is required when more than one runner deployment exists (e.g. v1, v2). If the deployment id is not specified in such scenario, both runners would process the same event, resulting in duplicate actions and responses. This is a rare case, typically used when deploying a new runner version while the old version is still running to avoid downtime (e.g. changing deployment id only after new version is up and running).

    • Inject: Whether these settings (e.g. input element, domain, etc.) should allow injection of key-value parameters and secrets or not.

    • Follow Ack: Whether event status ACK should continue saga flows instead of immediately returning

    • Response System: Alias of the system for the receiving runner to reply on. This setting is used when communication is through an event streaming platform (e.g. Kafka) and the response should be sent through a system different than the default.

    • Response Stream: Alias of the stream for the receiving runner to reply on. This setting is used when communication is through an event streaming platform (e.g. Kafka) and the response should be sent through a stream different than the default.

These settings work similar to a remote function call, where the handler and action define target function and other settings define its parameters for execution.

An event step can be executed locally or sent out to other runners for async and more scalable execution, orchestrating multiple microservices.

Event Validators

Similar to sagas, event steps allow configuring custom pre/post validators for validating input and output payloads against custom logic.

Event Step Data Schema

Using Preconfigured Actions

While it is possible to define all settings for each event step inside a saga, especially for high volume and low latency requirements, it may be preferrable to define default values once and reuse them for each call.

There are 3 alternative ways of achieving this, which can be also combined together based on the use case:

  1. Defining predefined "Action" records and using Execute Predefined Actions handler to call them.

  2. Defining structural Actions runner elements with the default values and using them as event actions for requests to runners with these elements.

  3. Defining metadata overrides to streams through which these action requests are sent to the target event runners.

This approach has 2 main benefits:

  1. Not sending the same list of settings with each request decreases the size of data transferred and stored.

  2. It becomes possible to update the list of parameters used for same type of request across all sagas at once.

Last updated