> For the complete documentation index, see [llms.txt](https://docs.xyb.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.xyb.co/xyb-payments/payment-setup/payment-workflows.md).

# Payment Workflows

**Payment Workflows** in the XYB Console are prebuilt, configurable flows designed to automate and control the lifecycle of a payment from initiation through validation, creation, authorization, and final clearance.

These workflows allow you to:

* Standardize payment logic across your platform
* React dynamically to failures or alternate states
* Integrate payment activity with other services like tasks, alerts, and ledger updates

<figure><img src="https://2629557980-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ft2bhF7867UQZjmdpxWXV%2Fuploads%2FQeWYLBijvpszX1blmKcG%2Fimage.png?alt=media&amp;token=ccec7104-b2d7-4564-8350-971ad8468a0a" alt=""><figcaption></figcaption></figure>

***

### What You Can Define

Within a payment workflow, you can visually orchestrate how the system handles different events and states. For example:

* What happens when a payment is *requested*?
* How should the system respond if validation fails?
* When is a payment marked as *authorized* or *cleared*?
* What happens when a payment is *failed*?

Each of these can be represented as a node in the workflow, giving you full control over execution logic.

***

### Key Components

* **Start** node: The entry point to the flow
* **Payment state nodes**: Represent transitions like `REQUESTED`, `VALIDATED`, `CREATED`, `AUTHORIZED`, `FAILED`, or `CLEARED`
* **Conditional branches**: Define what happens based on success or failure
* **End** node: Marks the conclusion of a path

You can customize the logic between these nodes using platform events, variables, and service calls to enforce business rules.

### Who Is It For?

Payment workflows are typically used by:

* **Ops teams**, to define and adjust how payments behave
* **Product managers**, to prototype and test payment logic
* **Compliance or risk teams**, to introduce additional steps based on payment data

***


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.xyb.co/xyb-payments/payment-setup/payment-workflows.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
