Snippets

Snippets are reusable sets of logical steps within workflows that enhance both reusability and readability. They allow for more efficient workflow management by simplifying complex integrations.

Reusability

A set of logical steps within a workflow needs to be reused in multiple instances within the same workflow.

Readability

For complex integrations, workflows often require a large number of steps. Adding a layer of abstraction helps structure the workflow and enhances readability.

Snippets help speed up workflow development by minimizing repetitive steps. A snippet can consist of one step or a collection of steps. Once created, users can include snippets using the Snippet Tool in the main workflow.

Creating Snippets

Apart from inputs and outputs, a snippet must contain at least one step to use snippet in main workflow.

Inputs and Outputs

Inputs are defined to access data inside the snippet from the main workflow. And output is required and used to return data to the main workflow.

Inputs are optional and multiple inputs can be defined.

Inputs

Multiple Inputs format Supported: String, Number, Boolean, JSON. Users can also specify whether an input field is mandatory using the required option (Yes/No).

If an input field is not required, users can provide a default value. Snippet uses the default value if actual value is empty during execution.

Output

The output is the snippet's response. It is required and can be of any supported data types.

The output can either be a single step response or a list of responses from multiple steps, as determined by the user. Only one output will be returned from the snippet, which will then be accessible within the main workflow.

All other local step responses within a snippet will remain inaccessible outside the snippet.

Test Snippets

Using the Test Snippet option, users can test snippets during the workflow development process to ensure the functionality by providing sample inputs.

Using Snippets

Snippets can be used in the main workflow using the Snippet Tool.

Limitations

  • The scope of DataHub values are limited to the snippet.

  • Users can only access the defined snippet input inside a snippet and can only access the snippet response in the main workflow.

  • No Nested Snippets.Snippets can only be used at one level.

  • The Stop tool is not available inside the snippet tool.

  • The debugger option is currently not available for snippet steps.

Last updated

Was this helpful?