Skip to main content

core.transform.scatter

Transform a collection of items into parallel execution streams, where each item is processed independently.

Inputs

collection
string | array[any]
required
The collection to scatter. Each item in the collection will be processed independently in its own execution stream. This should be a JSONPath expression to a collection or a list of items.
interval
number | null
The interval in seconds between each scatter task.Default: null.

Examples

Fan out and collect results
- ref: scatter_hosts
  action: core.transform.scatter
  args:
    collection: ${{ TRIGGER.hosts }}
- ref: check_host
  action: core.http_request
  depends_on:
    - scatter_hosts
  args:
    url: https://scanner.example.com/hosts/${{ ACTIONS.scatter_hosts.result.id }}
    method: GET
- ref: gather_results
  action: core.transform.gather
  depends_on:
    - check_host
  args:
    items: ${{ ACTIONS.check_host.result }}
    drop_nulls: true
    error_strategy: partition

core.transform.gather

Collect the results of a list of execution streams into a single list.

Inputs

items
string
required
The JSONPath expression referencing the item to gather in the current execution stream.
drop_nulls
boolean
Whether to drop null values from the final result. If True, any null values encountered during the gather operation will be omitted from the output list.Default: false.
error_strategy
string
Controls how errors are handled when gathering. “partition” puts successful results in .result and errors in .error. “include” puts errors in .result as JSON objects. “drop” removes errors from .result. “raise” fails the gather if any branch errors.Default: "partition".Allowed values: partition, include, drop, raise.

Examples

Fan out and collect results
- ref: scatter_hosts
  action: core.transform.scatter
  args:
    collection: ${{ TRIGGER.hosts }}
- ref: check_host
  action: core.http_request
  depends_on:
    - scatter_hosts
  args:
    url: https://scanner.example.com/hosts/${{ ACTIONS.scatter_hosts.result.id }}
    method: GET
- ref: gather_results
  action: core.transform.gather
  depends_on:
    - check_host
  args:
    items: ${{ ACTIONS.check_host.result }}
    drop_nulls: true
    error_strategy: partition