Payment Processing
Let us consider the example of a payment processing circuit. When you win a deal, you send a payment link to the deal and generate an invoice on successful payment. When the payment fails, you send the payment link again.
Circuit Flow
Start -> Fetch the deal (Record state) -> Send payment link (Function) -> Wait for payment to complete (Wait state) -> Update latest payment status (Function) -> Check payment status (Record state) -> Create an invoice upon successful payment or Resend the payment link to the deal
Prerequisites
A function that parses the details of the deal record, fetches the email ID, fetches the right payment URL and sends it to the deal.
A function that checks the payment status and updates the corresponding fields in CRM.
A function that generates an invoice on successful payment, or resends the payment link to the deal upon payment failure.
Start.
Use the Record state under Zoho CRM in the circuit to get the details of the deal you won. Pass the email ID of the deal to the next state.
Use the state Function under Zoho CRM that takes the value of the "Email" as input from the previous state. This function sends a payment link to the deal's email ID.
Use the Wait state to wait until the payment is complete. You can configure the duration of wait in this state until the circuit passes on to the next.
Use the Record state under Zoho CRM to get the status of the payment. Use the value of this field in the next state.
Use the state Function state under Zoho CRM to use the function that creates an invoice upon successful payment or invoke the function that resends the payment link to the link upon payment failure.
End.