Learn how to define workflows as code within a Paragraph project.
workflows/
folder of your selected integration:
define
function of a workflow, steps can be created and configured. A step can be created in one of the following ways:
@useparagon/core
library and configured to include the parameters that are required to run the step.integration
parameter passed to the define
function.@useparagon/core
package: @useparagon/core Glossary.
define()
function in any order. You will define an explicit flow/ordering for the steps using orchestration functions: see Orchestrating steps.
To reference step output in another step, simply access the .output
property of a step or trigger:
{{1.output.contact.email}}
syntax of the Workflow Editor. For more advanced transformations on outputs, use a Function step.
context
parameter of the define()
function.
The .getEnvironmentSecret
function will use the Environment Secret value stored at a specified key.
.getInput
function will get the value of a User Setting. You can reference integration-level User Settings by importing from the integration’s inputs.ts
file or workflow-level User Settings with this.inputs
.
connectUser
parameter of the define()
function.
persona.meta.ts
file at the root of your Paragraph src/
folder. You can export an example metadata object from that file to expose available fields.
ConditionInput
parameters, such as the Conditional Step or Stop Condition for Request Step Pagination.
When you need to define a condition, start by importing the Operators
from @useparagon/core
:
.next()
function, available for every step. For example:
.whenTrue()
and .whenFalse()
for creating execution branches when a condition is True or False.
.whenTrue
or .whenFalse
functions. If unspecified, the respective True/False branch will be empty.
.branch
, for creating a branch of execution that runs in parallel over an array of data.
Note that the branch function is not chainable.
src/
folder (the name can be anything except integrations
).
For example, you can create a common/
folder within src/
:
execution
data, you can import the static Execution
class from the @useparagon/workflow
library: