> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flowx.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Tutorial: Build a credit card application

> Learn FlowX.AI by building a complete credit card request flow with forms, integrations, and notifications.

In this tutorial, you'll build a credit card application process from scratch. By the end, you'll understand how to:

* Design a BPMN process with multiple node types
* Create user-facing forms
* Integrate with external systems
* Handle branching logic based on business rules
* Send notifications

<Info>
  **Time required:** 30-45 minutes

  **Prerequisites:**

  * Access to FlowX Designer
  * A workspace and project set up ([create one here](/5.9/docs/projects/workspaces))
</Info>

***

## What you'll build

A customer requests a new credit card through a bank app. The process:

1. Collects personal information
2. Checks credit score automatically
3. Assigns a card type based on the score
4. Sends confirmation email
5. Lets the user pick a branch for card pickup

Here's the complete BPMN diagram:

<Frame>
  ![Credit card application process](https://s3.eu-west-1.amazonaws.com/docx.flowx.ai/3.5/request_a_credit_card_new.png)
</Frame>

<Card title="Download this process" href="https://s3.eu-west-1.amazonaws.com/docx.flowx.ai/release40/sample_bpmn_process_new_credit_card.bpmn" icon="download">
  Import this BPMN file to follow along or explore the finished result.
</Card>

***

## Step 1: Create the process

<Steps>
  <Step title="Open your project">
    Navigate to **FlowX Designer** → your workspace → your project.
  </Step>

  <Step title="Create a new process">
    Click **New** → **Process**. Name it `credit-card-request`.
  </Step>

  <Step title="Add a Start Event">
    Drag a **Start Event** node onto the canvas. This is where the process begins when a customer opens the credit card application.
  </Step>
</Steps>

<Card title="Learn more about processes" href="/5.9/docs/building-blocks/process/process" icon="book" />

***

## Step 2: Collect user data (User Task)

The first step is collecting the customer's personal information.

<Steps>
  <Step title="Add a User Task">
    Drag a **User Task** node after the Start Event. Name it `Fill Personal Data`.
  </Step>

  <Step title="Design the form">
    In the node settings, open the **UI Designer**. Add form fields:

    * Full name (text input)
    * Email (text input with email validation)
    * Date of birth (date picker)
    * Annual income (number input)
  </Step>

  <Step title="Configure the data model">
    Map each field to a key in your data model:

    * `application.fullName`
    * `application.email`
    * `application.dateOfBirth`
    * `application.annualIncome`
  </Step>
</Steps>

<Card title="Learn more about User Tasks" href="/5.9/docs/building-blocks/node/user-task-node" icon="book" />

***

## Step 3: Check credit score (Service Task)

Now we'll call an external credit scoring service automatically.

<Steps>
  <Step title="Add a Send Message Task">
    This sends the customer data to your credit score adapter.

    Configure the Kafka topic to send to your credit scoring integration.
  </Step>

  <Step title="Add a Receive Message Task">
    This waits for the credit score response.

    Map the response to `application.creditScore`.
  </Step>
</Steps>

<Tip>
  Don't have a credit score service? For testing, use a **Business Rule** node to simulate a score based on annual income.
</Tip>

<Card title="Learn more about integrations" href="/5.9/docs/platform-deep-dive/integrations/integrations-overview" icon="book" />

***

## Step 4: Branch based on credit score (Exclusive Gateway)

Different credit scores qualify for different card types.

<Steps>
  <Step title="Add an Exclusive Gateway">
    This creates a decision point based on the credit score.
  </Step>

  <Step title="Configure branch conditions">
    * **Branch 1:** `application.creditScore >= 700` → Premium card
    * **Branch 2:** `application.creditScore >= 500` → Standard card
    * **Branch 3:** Default → Basic card
  </Step>

  <Step title="Add Service Tasks for each branch">
    Each branch sets the card type:

    ```javascript theme={"system"}
    output.put("application.cardType", "PREMIUM");
    ```
  </Step>

  <Step title="Add a Closing Gateway">
    Merge the branches back together after the card type is set.
  </Step>
</Steps>

<Card title="Learn more about Gateways" href="/5.9/docs/building-blocks/node/exclusive-gateway-node" icon="book" />

***

## Step 5: Show results and confirm (User Task)

Let the customer review their card type and confirm.

<Steps>
  <Step title="Add a User Task">
    Name it `Review and Confirm`.
  </Step>

  <Step title="Design the confirmation screen">
    Display the assigned card type and benefits. Add a **Confirm** button.
  </Step>
</Steps>

***

## Step 6: Send notification and register (Parallel Gateway)

After confirmation, two things happen simultaneously:

<Steps>
  <Step title="Add a Parallel Gateway">
    This splits the flow into parallel branches.
  </Step>

  <Step title="Branch 1: Send confirmation email">
    Add a **Send Message Task** that triggers the notification plugin.

    Configure email template with customer name and card type.
  </Step>

  <Step title="Branch 2: Register in bank system">
    Add a **Send Message Task** to your bank system adapter.

    This creates the card request in your core banking system.
  </Step>

  <Step title="Add a Closing Parallel Gateway">
    Wait for both branches to complete before continuing.
  </Step>
</Steps>

<Card title="Learn more about Notifications" href="/5.9/docs/platform-deep-dive/core-extensions/content-management/notifications-plugin/notifications-plugin-overview" icon="book" />

***

## Step 7: Select pickup location (User Task)

Let the customer choose where to pick up their card.

<Steps>
  <Step title="Add a Service Task to fetch locations">
    Call an API (like Google Maps) to get nearby branches based on customer address.
  </Step>

  <Step title="Add a User Task">
    Display the top 3 branches as selectable options.
  </Step>
</Steps>

***

## Step 8: End the process

<Steps>
  <Step title="Add a Receive Message Task">
    This waits for confirmation that the customer picked up the card (from branch system).
  </Step>

  <Step title="Add an End Event">
    The process completes.
  </Step>
</Steps>

***

## Test your process

<Steps>
  <Step title="Save and validate">
    Click **Save**. Fix any validation errors shown.
  </Step>

  <Step title="Start a process instance">
    Click **Run** to start a new instance. Fill in the forms and watch the process flow.
  </Step>

  <Step title="Check the token">
    Use the **Process Instance** view to see where the token is and inspect data at each step.
  </Step>
</Steps>

***

## What you learned

You've built a complete process that demonstrates:

| Concept               | How you used it                                |
| --------------------- | ---------------------------------------------- |
| **User Tasks**        | Collecting data, showing confirmations         |
| **Service Tasks**     | Calling external APIs, setting data            |
| **Exclusive Gateway** | Branching based on credit score                |
| **Parallel Gateway**  | Running email + registration simultaneously    |
| **Integrations**      | Credit score check, bank system, notifications |

***

## Next steps

<CardGroup cols={2}>
  <Card title="UI components" href="/5.9/docs/building-blocks/ui-designer/ui-designer" icon="browser">
    Learn all available form and display components
  </Card>

  <Card title="Business rules" href="/5.9/docs/building-blocks/actions/business-rule-action/business-rule-action" icon="gavel">
    Add complex logic with DMN or scripts
  </Card>

  <Card title="Error handling" href="/5.9/docs/building-blocks/node/error-events" icon="triangle-exclamation">
    Handle failures gracefully
  </Card>

  <Card title="FlowX Academy" href="https://academy.flowx.ai" icon="graduation-cap">
    Take structured courses with certifications
  </Card>
</CardGroup>
