With chain templates, you can create a pre-built sequence of commands and events for use as a partial snippet or a complete chain. For example, with templates, you can:
- Provide a head start to ease chain creation.
- Standardize common workflows, such as to extract data from your system of record.
Note: You can use a template with multiple chains, workspaces, and environments in Chain Builder.
Create a template from an existing chain
To create a template, you can use a published chain as its basis, or you can build a new sequence of commands and events from scratch. Building a template from an existing chain offers a number of benefits:
- You can use the first chain as a starting point to create other chains.
- You can share the chain with others using Chain Builder—including those at other organizations, such as in the Workiva Community.
To create a template from an existing chain:
- From Chains, click Chain Builder.
- Select the Chains tab, and then select Edit for the chain.
- From the chain's three-dot menu at the top right, select Create template.
- Enter a unique name and description to help identify the template.
- Under Folders, select where to save the template.
- Click Save.
- If the chain has any variables, set up each template variable:
- Enter the default name for the template variable.
Tip: To help identify the value to use with a variable, we recommend you include a prefix with its name. For example,
WSV-
for a workspace variable,CV-
for a chain variable,DCV-
for a dynamic chain variable, orResource-
for a workspace resource. - To ease portability and reuse, delete the default values.
- Select whether a dynamic chain variable or workspace resource will provide the value.
Note: If a chain variable, workspace variable, or runtime variable provides the value, select neither Dynamic nor Resource.
- Enter the default name for the template variable.
- Click Save and Publish.
Create a template from scratch
To build a new sequence of commands and events as a reusable framework for chains, follow these sequences of steps.
Step 1: Add the template
- In Chain Builder, from the Templates tab, click Create => Template at the top right.
- To create the template someplace other than the Default folder, click Edit for its folder, select the folder to save the template, and click Move.
- Enter a unique name and description to help identify the template and its intent.
Tip: To help identify whether a template provides a sequence for a full or partial chain, include a prefix with its name. For example,
Full-
for a complete chain, orPart-
for a partial chain or snippet.
Step 2: Set up the template's variables
To ease customization and reuse, templates contain variables as placeholders for values required for its commands' variables or workspace resources. When you create a chain from the template, the chain's variables and resources replace the template's variables.
For each variable to include in the template:
- Under Template Variables, click Add.
- Enter the variable's name and default value.
Tip: To help identify the value to use with a template variable, we recommend you include a prefix with its name. For example,
WSV-
for a workspace variable,CV-
for a chain variable,DCV-
for a dynamic chain variable, orResource-
for a workspace resource. - Under Type, select whether a dynamic chain variable or workspace resource will provide the variable's value.
Note: If a chain variable, workspace variable, or runtime variable provides the value, select neither Dynamic nor Resource.
After you add all variables for the template, click Save.
Note: To remove a variable from the template, click its X under Actions.
Step 3: Define the nodes of the template
As you build a template, set up and link the nodes in its sequence:
- Commands or tasks executed by chains created from the template, such as to interact with the Workiva platform or another data source.
- Events that occur within the template, such as to enable an approval workflow or manual upload of files.
- Trigger Events, such as runtime inputs to set variables—such as to specific accounts, regions, or time periods—when you execute chains created from the template, or to automatically start the chain based on changes in connected sources.
Note: To enable customization and reuse, a template's commands don't use connections, runners, or variables set in the chain or workspace; you'll specify these when you create a chain from the template.
When you add a node, move it to where it occurs in the sequence, and link it to its next and previous steps.
- To add the first node of the template, move it to Start.
- To add a node as the start of a new branch of a logic tree, link the previous step in the template to the first node of the multiple branches.
- To run commands in parallel with each other or together as part of a serial process, create a command group as the step.
Note: By default, a node runs when the linked previous node succeeds. To enable conditional logic, such as to run a node only when the previous node fails, double-click the link and select its condition—success
, failure , warning , or any .After you define the nodes of the template, click Publish.
Edit a template's settings
To adjust a template's name or description, or to manage its variables:
- In Chain Builder, from the Templates tab, click the template's name and Template Settings.
- Edit the template's name, description, or variables as necessary.
- Click Save and Publish.
View chains that use a template
To view which chains are created from a template, go to theTemplates
tab, and then click View for the template under Chains Using.From the In Use panel, the chains created from the template appear. To open a chain, click its name.
Tip:To find a specific chain, search by its name.
Copy templates
To use a template as the starting point for a new template, create a copy of it. In Chain Builder, from the Templates
tab, click Copy for the template.Share templates with others
To help others create chains, you can share links to published templates with others using Chain Builder—including those at other organizations, such as in the Workiva Community.
- In Chain Builder, from the Templates
- Click Copy to clipboard and Close.
- Paste and share the link with others as necessary.
Please keep in mind that templates are dependent on both workspaces having access to the same connectors and commands. When sharing a template with another workspace, the imported chain won’t work unless all required connectors are enabled.
When importing a chain, you'll have the opportunity to set up any missing connectors:
Revoke access to a shared template
To revoke others' access to a shared template, refresh its URL to create a new link:
- In Chain Builder, from the Templates tab, click Get shareable link for the template.
- Click Regenerate token and Close.
Archive templates
If you no longer need a template, you can archive it. In Chain Builder, click Templates
, and click Archive for the template.