Template Template

yaml
type: "io.kestra.core.tasks.flows.Template"

Include a reusable template inside a flow.

Examples

yaml
id: template
namespace: io.kestra.tests

inputs:
  - id: with-string
    type: STRING

tasks:
  - id: 1-return
    type: io.kestra.core.tasks.debugs.Return
    format: "{{ task.id }} > {{ taskrun.startDate }}"
  - id: 2-template
    type: io.kestra.core.tasks.flows.Template
    namespace: io.kestra.tests
    templateId: template
    args:
      my-forward: "{{ inputs.with-string }}"
  - id: 3-end
    type: io.kestra.core.tasks.debugs.Return
    format: "{{ task.id }} > {{ taskrun.startDate }}"

Properties

namespace

  • Type: string
  • Dynamic:
  • Required: ✔️

The namespace of the template.

templateId

  • Type: string
  • Dynamic:
  • Required: ✔️

The ID of the template.

args

  • Type: object
  • SubType: string
  • Dynamic: ✔️
  • Required:

The arguments to pass to the template.

You can provide a list of named arguments (like function argument on dev) allowing to rename outputs of current flow for this template. For example, if you declare this use of template like this:

yaml
  - id: 2-template
    type: io.kestra.core.tasks.flows.Template
    namespace: io.kestra.tests
    templateId: template
    args:
      forward: "{{ output.task-id.uri }}"

You will be able to get this output on the template with .

errors

  • Type: array
  • SubType: Task
  • Dynamic:
  • Required:

List of tasks to run if any tasks failed on this FlowableTask.

tenantId

  • Type: string
  • Dynamic:
  • Required:

Outputs

args

  • Type: object
  • Dynamic:
  • Required:

The arguments passed to the template.