A custom workflow consists of a trigger and one or more actions.
GoFormz workflows have two types steps: triggers and actions. The trigger is the event that puts the workflow into motion. Triggers can be internal (e.g. when a user completes a form) or external (e.g. when a new object is created in Salesforce). Actions are what you want GoFormz to do when the trigger occurs. You can string multiple actions together, so the same trigger may cause a series of actions to occur.
Each trigger and action has inputs and outputs:
- Inputs are fields that must be filled in for the trigger to function properly. Input values can make use of recipe workflow variables to reference outputs from previous steps.
- Required vs Optional: Required inputs must be filled in for the step to function properly; your workflow will halt with an error if a required field is not filled in. Optional inputs are not needed for a step to work, but provide additional specifications for how the step should function. Throughout this documentation, we specify which fields are required and which are optional.
- Built-in vs Write-in: Built-in inputs are inputs that you can see when you create the step; required inputs and other frequently used inputs will often be built-in for convenience. Write-in inputs have to be added to the step manually via the Add Key/Value button on the step's screen.
- Outputs are data returned upon the action’s successful completion; this data can be used in subsequent workflow steps.
Inputs and outputs have two other properties that are important to understand:
- A step's input automatically becomes its output. This means you can use recipe workflow variables to reference a prior step's input in the same way that you reference its output.
- Trigger outputs automatically become inputs for all subsequent steps. One consequence of this is that when you use the Form Completed trigger, you don't have to explicitly specify a form ID on any subsequent actions, since the completed form's ID will automatically be included as an input on all subsequent actions. However, be careful — if you want to perform an action on a form other than the completed form and forget to specify the form ID, your workflow will still work but you will get some unexpected results! For this reason, as a best practice, we recommend that you always explicitly specify step inputs, rather than relying on this transference property.
Here is an example of a simple custom workflow that shows the interplay of triggers and actions, as well as their inputs and outputs. In this example, the custom workflow sends a form PDF and some form data to a Salesforce object whenever a form is completed.
- First, we have the Form Completed trigger. It has a required built-in
Templateinput as shown below; this specifies which type of form should trigger the workflow. It also includes the completed form's field values and some form metadata as its outputs.
- Next, we have the Export Form To PDF action. It has an optional
pagesinput to determine which form pages should be exported, and it outputs the URL of the PDF it creates.
- Finally, we have the Salesforce: Update Object action. It has a Salesforce connection as a required built-in input, and two required write-in inputs (
sObjectId) that specify which Salesforce object should be updated. It also has write-in optional inputs that specify which fields within the Salesforce object should be updated, and what they should be updated with. Note also that in this example we use recipe workflow variables to reference outputs from both the Form Completed trigger (form fields values, form name) and the Export action (PDF URL).
Updated almost 4 years ago