With chain templates, you can create a pre-built sequence of commands and events for use as a partial snippet to 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.
To view and manage templates in Chain Builder, click Templates
.Create a template
To create a sequence of command and events as a framework for new chains:
Step 1. Add the template
- From Chains , click Open Chain Builder.
- In Chain Builder, click Templates
- 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 will provide the variable's 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.
Note: You can add a Run Chain event to chains created from a template, not the template itself.
- 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.
Create a chain from a template
After you publish a template, you can use it as the framework for a new chain.
Step 1. Create the chain
- In Chain Builder, you can create a chain based on a template from either Templates
- From Templates, click the template's name, and then click New Chain.
- From Build, click Create Chain, Create Chain from Template, and then select the template to use, and click Create From Template.
or Build :
- From Templates, click the template's name, and then click New Chain.
- Enter a unique name to help identify the chain.
- Select the workspace and environment to use the chain, and click Next.
Step 2. Map the template's variables and connections
- For each template variable, select the value to replace it in the chain:
- For a variable value set within the chain, select a Variable Type of Chain, and enter a name for the new chain variable.
- For a variable value set within the workspace, select a Variable Type of Workspace, and select the workspace variable to use.
- For a file uploaded as a resource within the workspace, select a Variable Type of Workspace Resource, and select the resource to use.
- For a dynamic variable value set when the chain runs, select a Variable Type of Chain Dynamic, and enter a name for the new dynamic chain variable.
- For a value generated when the chain runs, select a Variable Type of Runtime, and select the runtime variable to use.
Note: If you select Dynamic or Resource when you add the variable to the template, you can't select a different variable type.
- After you map the template's variables to their new variables or resources, click Next.
- For each connection used in the template, select the connector and runner to perform its commands, and click Submit.
Step 3. Finalize the fhain
- Click View Your New Chain.
- Customize the new chain as necessary:
- Update any chain variables used by the template's variables.
- Add any additional commands or events to start or complete the chain.
- Click Publish.
Edit a template's settings
To adjust a template's name or description, or to manage its variables:
- In Chain Builder, click Templates , and then click the template's name.
- Click 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 in Chain Builder, click Templates
, 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, click Templates
, and click Copy for the template.Archive templates
If you no longer need a template, you can archive it. In Chain Builder, click Templates
, and click Archive for the template.