# How to Use action_fastline_pro Action in Scenario?

The `action_fastline_pro` action allows using an AI agent or chatbot created in FastLinePro in a bot scenario. This allows integrating smart AI responses into the dialogue with the user.

---

## When Needed

- You need to use an AI agent to answer user questions.
- You need to integrate a chatbot with a knowledge base into the scenario.
- You need to automate responses to typical questions via AI.

---

## What's Important to Know

- **action_fastline_pro** — action for calling an AI agent from FastLinePro.
- Agent name must exactly match the name specified in FastLinePro.
- Conversation ID is responsible for saving dialogue context.
- Vision file allows the agent to process images and files.

---

## Prerequisites

- [x] You are logged in with integrator or administrator rights.
- [x] There is a created AI agent or chatbot in FastLinePro in the system.
- [x] You have access to the scenario constructor.

---

## Step-by-Step Instructions

1. In the scenario constructor, add an **"Action"** block in the needed place in the scenario.
2. In the "Action" block settings, select the **`action_fastline_pro`** function.
3. In the configuration field (JSON), enter parameters:

```json
{
  "agent_name": "Your company agent",
  "user_input": "{{question}}",
  "vision_file": true,
  "conversation_id": "fl_client_id",
  "save_response": "client_answer",
  "inputs": {
    "first_name": "Bohdan"
  }
}
```

### Action Parameters

- **`agent_name`** — name of the AI agent you created and connected in the interface. Must exactly match the name specified in Fast Line Pro.
- **`user_input`** — user question or query. Usually this variable is filled in the previous step of the scenario, for example: `{{question}}`.
- **`vision_file`** — boolean parameter that determines whether the agent has access to files, images, and other attachments:
  - `true` — agent sees files
  - `false` — agent works only with text
- **`conversation_id`** — variable responsible for saving dialogue context. If you pass an empty value — the agent will treat the query as the start of a new dialogue. After the first response, it will generate a `conversation_id` itself, which should be saved and passed in subsequent queries.
- **`save_response`** — name of the variable where the agent's response will be saved. For example: `client_answer`.
- **`inputs`** — object containing all variables you want to pass to the agent (must be previously created in the agent's "Variables" block).

4. Save changes in the action and scenario.

---

## Usage Example

**Scenario:**
1. "Wait for Response" block → user enters a question, saved in `{{question}}`
2. "Action" block with `action_fastline_pro` → agent responds, saved in `{{client_answer}}`
3. "Message" block → displays `{{client_answer}}`

---

## What Happens After

After executing the action, the AI agent processes the user's query and generates a response based on its instructions and knowledge base (if connected). The response is saved to the variable specified in `save_response` and can be used in subsequent scenario blocks.

---

## How to Verify It Worked

- Check that the agent name in `agent_name` exactly matches the name in FastLinePro.
- Make sure all parameters are specified correctly.
- Test the scenario and check that the agent responds correctly.
- Check that the response is saved to the variable from `save_response`.

---

## Related Materials

- [Check agent response](/en/fastlinepro/how-to/check-agent-response.md)
- [Check agent response](/en/fastlinepro/how-to/check-agent-response.md)
- [Create agent](/en/fastlinepro/how-to/create-agent.md)

