Template
Configuration for a flowfile template; templates can be used to generate flow files.
Properties
Required:
template
Properties:
| Field | Description | Type | Default | Required |
|---|---|---|---|---|
artifacts | A list of artifacts to be copied after generating the flow file. | array (Artifact) | ||
form | 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. | array (Field) | [] | |
postRun | A list of exec executables to run after generating the flow file. | array (TemplateRefConfig) | ||
preRun | A list of exec executables to run before generating the flow file. | array (TemplateRefConfig) | ||
template | The 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:
| Field | Description | Type | Default | Required |
|---|---|---|---|---|
asTemplate | If 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. | boolean | false | |
dstDir | The 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 | ||
dstName | The name of the file to copy to. If not set, the file will be copied with the same name. | string | ||
if | An 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 | ||
srcDir | The directory to copy the file from. If not set, the file will be copied from the directory of the template file. | string | ||
srcName | The 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 wsor simplyexec).
Type: string
Field
A field to be displayed to the user when generating a flow file from a template.
Type: object
Properties:
| Field | Description | Type | Default | Required |
|---|---|---|---|---|
default | The default value to use if a value is not set. | string | ||
description | A description of the field. | string | ||
group | The group to display the field in. Fields with the same group will be displayed together. | integer | 0 | |
key | The key to associate the data with. This is used as the key in the template data map. | string | ✘ | |
prompt | A prompt to be displayed to the user when collecting an input value. | string | ✘ | |
required | If true, a value must be set. If false, the default value will be used if a value is not set. | boolean | false | |
type | The type of input field to display. | string | text | |
validate | A regular expression to validate the input value against. | string |
TemplateRefConfig
Configuration for a template executable.
Type: object
Properties:
| Field | Description | Type | Default | Required |
|---|---|---|---|---|
args | Arguments to pass to the executable. | array (string) | [] | |
cmd | The command to execute. One of cmd or ref must be set. | string | ||
if | An 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 | ||
ref | A reference to another executable to run in serial. One of cmd or ref must be set. | ExecutableRef |

