Skip to content

Template

Configuration for a flowfile template; templates can be used to generate flow files.

Properties

FieldTypeDefaultRequiredDescription
annotationsCommonAnnotationsmap[]
artifactsarray (Artifact)A list of artifacts to be copied after generating the flow file.
descriptionstringA description of the template. This is used to describe what the template generates and when to reach for it, and is shown when browsing templates.
formarray (Field)[]Form fields to be displayed to the user when generating a flow file from a template. The form will be rendered first, and the user's input can be used to render the template.
postRunarray (TemplateRefConfig)A list of exec executables to run after generating the flow file.
preRunarray (TemplateRefConfig)A list of exec executables to run before generating the flow file.
templatestringYesThe flow file template to generate. The template must be a valid flow file after rendering.

Definitions

Artifact

File source and destination configuration. Go templating from form data is supported in all fields.

Type: object

FieldTypeDefaultRequiredDescription
asTemplatebooleanfalseIf true, the artifact will be copied as a template file. The file will be rendered using Go templating from the form data. Expr language functions are available for use in the template.
dstDirstringThe directory to copy the file to. If not set, the file will be copied to the root of the flow file directory. The directory will be created if it does not exist.
dstNamestringThe name of the file to copy to. If not set, the file will be copied with the same name.
ifstringAn expression that determines whether the the artifact should be copied, using the Expr language syntax. The expression is evaluated at runtime and must resolve to a boolean value. If the condition is not met, the artifact will not be copied. The expression has access to OS/architecture information (os, arch), environment variables (env), form input (form), and context information (name, workspace, directory, etc.). See the flow documentation for more information.
srcDirstringThe directory to copy the file from. If not set, the file will be copied from the directory of the template file.
srcNamestringThe name of the file to copy.

CommonAnnotations

A map of arbitrary string key/value metadata attached to the object. Annotations are intended for use by external tools and integrations to store system metadata. Unlike tags, annotations are not used for filtering or display in the Flow UI - treat them as opaque state. Keys should be namespaced (e.g. my-tool.example.com/state) to avoid collisions between tools.

Type: map (string -> string)

ExecutableRef

A reference to an executable. The format is <verb> <workspace>/<namespace>:<executable name>. For example, exec ws/ns:my-workflow.

  • If the workspace is not specified, the current workspace will be used.
  • If the namespace is not specified, the current namespace will be used.
  • Excluding the name will reference the executable with a matching verb but an unspecified name and namespace (e.g. exec ws or simply exec).

Type: string

Field

A field to be displayed to the user when generating a flow file from a template. Type: object

FieldTypeDefaultRequiredDescription
defaultstringThe default value to use if a value is not set.
descriptionstringA description of the field.
groupinteger0The group to display the field in. Fields with the same group will be displayed together.
keystringYesThe key to associate the data with. This is used as the key in the template data map.
promptstringYesA prompt to be displayed to the user when collecting an input value.
requiredbooleanfalseIf true, a value must be set. If false, the default value will be used if a value is not set.
typestringtextThe type of input field to display.
validatestringA regular expression to validate the input value against.

TemplateRefConfig

Configuration for a template executable. Type: object

FieldTypeDefaultRequiredDescription
argsarray (string)[]Arguments to pass to the executable.
cmdstringThe command to execute. One of cmd or ref must be set.
ifstringAn expression that determines whether the executable should be run, using the Expr language syntax. The expression is evaluated at runtime and must resolve to a boolean value. If the condition is not met, the executable will be skipped. The expression has access to OS/architecture information (os, arch), environment variables (env), form input (form), and context information (name, workspace, directory, etc.). See the flow documentation for more information.
refExecutableRefA reference to another executable to run in serial. One of cmd or ref must be set.