Skip to content

Template

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

Properties

Required:

  • template

Properties:

FieldDescriptionTypeDefaultRequired
artifactsA list of artifacts to be copied after generating the flow file.array (Artifact)
formForm 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.array (Field)[]
postRunA list of exec executables to run after generating the flow file.array (TemplateRefConfig)
preRunA list of exec executables to run before generating the flow file.array (TemplateRefConfig)
templateThe flow file template to generate. The template must be a valid flow file after rendering.string

Definitions

Artifact

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

Type: object

Properties:

FieldDescriptionTypeDefaultRequired
asTemplateIf 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.booleanfalse
dstDirThe 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.string
dstNameThe name of the file to copy to. If not set, the file will be copied with the same name.string
ifAn 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.string
srcDirThe directory to copy the file from. If not set, the file will be copied from the directory of the template file.string
srcNameThe name of the file to copy.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

Properties:

FieldDescriptionTypeDefaultRequired
defaultThe default value to use if a value is not set.string
descriptionA description of the field.string
groupThe group to display the field in. Fields with the same group will be displayed together.integer0
keyThe key to associate the data with. This is used as the key in the template data map.string
promptA prompt to be displayed to the user when collecting an input value.string
requiredIf true, a value must be set. If false, the default value will be used if a value is not set.booleanfalse
typeThe type of input field to display.stringtext
validateA regular expression to validate the input value against.string

TemplateRefConfig

Configuration for a template executable.

Type: object

Properties:

FieldDescriptionTypeDefaultRequired
argsArguments to pass to the executable.array (string)[]
cmdThe command to execute. One of cmd or ref must be set.string
ifAn 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.string
refA reference to another executable to run in serial. One of cmd or ref must be set.ExecutableRef