Create more granular workflows
With all the tools available to create sophisticated workflows, you might be tempted to create big workflows achieving many tasks in one go. While this is technically possible, it will become cumbersome to maintain and potentially introduces a lot of redundancy when you have to repeat certain steps. Workflows give you many tools to have more granular workflows based on use cases:- Apps will emit events as Triggers which you can react to in a workflow.
- When you create multiple workflows based on the same Trigger, the Trigger Conditions can ensure only certain conditions actually start a workflow.
Reduce redundancy
When you set up a payment flow that includes multiple routes, every time you authorize a payment for that route, you can set the “Authorize payment” action up in the best way possible to ensure payment success. However, once the action performed its assigned task, then you would need to check if the payment was authorized or declined before adding the “Capture payment” action.
One workflow with many routes
- one workflow to authorize payments
- and one to capture payments that have been authorized

Authorization flow

Capture flow

Trigger Set-Up

Multiple conditions
Flexibility
The aforementioned examples are not mutually exclusive, but can be combined based on use cases to allow for greater flexibility. An example would be if you want to create a support ticket for declined payments, and post failed payments into a Slack channel. Here you can either create two workflows, one with a Trigger Condition each (”Status=Declined”, “Status=Failed”) or combine them into one workflow for “Error handling” with the Trigger Condition being “Status one of Declined, Failed”. If you do the latter, then you can still add the condition builder and create one route for “Status = Declined”, and one route for “Status = Failed”. It’s best to keep the conditions explicit like that, and just keep the “all other conditions” block unmapped for better readability of the workflow.Handle third-party issues
Let’s consider a workflow using the “Post message to channel” action from Slack. During the execution of the workflow, anything but Slack successfully posting the message will result in a stop of the workflow execution at this block and result in aFailed
Workflow Run.
In case of failures, the Workflow Runs can be used to troubleshoot. Actions do not return a response status in the Outputs, which means that we assume that all Actions are running without issue.
If Slack did not post the message successfully then you can look at the Workflow Runs. Within the timeline you will be able to identify if the action was not successful due to invalid credentials, or any other possible configuration issue by opening the details for each event. See monitor workflows for more details on the Workflow Run details.
The assumption of an action being successful will allow you to chain multiple actions together, for example in a flow like this, where a ticket is created via Zendesk and then posted to Slack:

Create ticket for declines and post to slack
Failed
and no Slack message will be posted.
Workflow vs object status
Keep in mind that an app action can manipulate objects, for example the “Authorize payment” action can lead to a new payment status, whereas third-parties can avail actions to manipulate their objects, for example:- “Update customer” action updating a customer status from
PENDING_REVIEW
toAPPROVED
- “Update order” action updating an order status from
DISPATCHED
toFULFILLED
- “Confirm shipping” action returning an updated shipping status of
CONFIRMED
Avoid infinite loops
Certain combinations of triggers & actions can lead to an infinite loop of workflows being triggered. This must be avoided when building a workflow. If you combine the Zendesk trigger “Ticket created” with the Zendesk action “Create ticket”, that would result in an infinite loop:
Infinite loop example
If you accidentally create an infinite loop, Primer has technical mitigations in place to terminate workflow execution for the affected workflows and alert the product support team.
Creating test routes
The Conditions Utility allows you to reference any data point from a previous block, such as the Output of a Trigger or an action. During your integration you might want to create different routes to get familiar with branching logic. You could create different routes based on amount, currency, down to the individual e-mail address. This capability also allows you to create very specific test routes:
Test route via e-mail address
Start automating
- Now that you know the best practices, why not put the concepts to a test and start building workflows?
- In case your new workflows do not work as intended, check our monitor workflows guide to troubleshoot your workflows