Flow Automation: Triggering Workflows When a Payment Is Created
You can use the New Payment trigger in Flow Automation to automatically start a workflow whenever a new payment is created. A payment is a record the system creates for each payment attempt, capturing the amount and the result of that attempt. With this trigger, you can automatically alert your finance team to follow up when a payment fails, and track how many payments have failed.
This guide explains the actions supported by this trigger, how to test the workflow, and how to use it in a real-world scenario to follow up on failed payments promptly.
|
Notes:
|
Supported Actions
The following actions are primarily used in workflows initiated by the New Payment trigger:
- [General] Send email
- [General] Update counter
- [General] Delay
Testing the Workflow
To test whether the workflow is successfully triggered when a payment is created, follow these steps:
- In Flow Automation, set up a workflow using the New Payment trigger, then click Publish to activate it.
- On your online frontstore, add any product to the cart, proceed to checkout, and complete a payment using an enabled online payment method.
- After the payment is paid, go to Flow Automation to check the execution results.
| Note: For more information on how to monitor the execution of your workflows, please refer to the "How to View the Running of a Flow" section in the "Introduction to Flow Automation" guide. |
Example Use Case
Here is a practical example of using the New Payment trigger to follow up on failed payments promptly.
Scenario: When a customer’s payment fails, automatically notify your finance team so they can look into it, and record the number of failed payments.
- Trigger: New Payment
- Condition: Payment status equals paid_failed
-
Action: Send email
- Email subject: Payment Failure Alert: Payment [Payment order number]
- Email content: Payment [Payment order number] has failed. Message returned by the payment channel: [Status code]. Channel transaction ID: [Payment channel deal ID]. Please verify and follow up.
- Recipient email: Manually enter your finance team member’s email address
-
Action: Update counter
- Counter name: Number of failed payments
- Counter value: Add 1
- Outcome: Your finance team knows right away which payment didn’t go through and can use the channel transaction ID to check with the payment channel. The counter also shows whether failed payments suddenly increase, so you can look into issues with your payment methods early.
| Note: To insert the information shown in square brackets (such as the payment ID), click + Add variables and select the corresponding parameter. |