template

Builds a string by running the input through a Handlebars template. Typically paired with an exec channel.

Parameters

templaterequired

The Handlebars template string. It can reference the following fields:

  • effect - information about the effect that emitted the input - currently only includes key, the key of the effect
  • timestamp - the logical timestamp of the input
  • data - the input data generated by the effect's generator

Examples

cURL

type: exec
format:
  type: template
  template: >-
    curl -sS --fail-with-body -X {{data.method}} "${API_BASE_URL:-http://localhost:5173}{{{data.path}}}"
    {{#if data.body}}-H 'Content-Type: application/json' --data '{{json data.body}}'{{/if}}