# Bot Flow

**Graphical Node Introduction**

**Messaging Process Features**

* **Node Movement:** Nodes can be moved by dragging.
* **Testing:** Test third-party channels directly without switching to the channel each time.
* **Test and Production Versions:** All channels offer both test and production versions, except the web channel which only has a production version.

**Testing Interface**

<table><thead><tr><th>Channel</th><th data-type="checkbox">Card Template</th><th data-type="checkbox">Text Message</th><th data-type="checkbox">Image Message</th><th data-type="checkbox">Video Message</th><th data-type="checkbox">Voice Message</th><th data-type="checkbox">File Message</th></tr></thead><tbody><tr><td>Web</td><td>true</td><td>true</td><td>true</td><td>false</td><td>false</td><td>false</td></tr><tr><td>LINE</td><td>true</td><td>true</td><td>true</td><td>true</td><td>true</td><td>false</td></tr><tr><td>Messenger</td><td>true</td><td>true</td><td>true</td><td>true</td><td>true</td><td>true</td></tr><tr><td>Telegram</td><td>true</td><td>true</td><td>true</td><td>true</td><td>true</td><td>true</td></tr></tbody></table>

{% hint style="info" %}
Telegram does not support multiple card templates.

The bot can only output text with buttons; other formats require custom JSON output, including LINE's Flex Message.

(As of version 1.0.9, variable injection is not implemented and only fixed JSON output can be used.)

For more details, refer to this [documentation link](https://docs.communeify.com/tw/products/dmflow/tutorials/docs/bot-template.html).
{% endhint %}

{% hint style="warning" %}

**Pre-development Notes for Bots**

* **Start Node:** The start node is not necessarily the welcome node and can be called with /start.
* **Reply Node Interruption:** Initially included intent judgment within conditional statements, but intent has been removed in the cloud version, reducing its effectiveness. This feature now redirects to branches that satisfy conditions if the node falls back.
* **Using "/" Commands:** Scenarios can be directly jumped to with commands starting with "/". For example, from scenario A, if the bot asks "your message" and you type /B for information, after completing /B, it returns to scenario A and reasks "your message". Jumping to another node does not cancel the current node.
  {% endhint %}

**Resource Node**

The resource node can invoke other APIs and return results based on the conversation entity. It is synchronous by default, waiting for a response before proceeding. The timeout for this node is five seconds. Future versions will allow unlimited internal API calls.

**Reply Node**

Can output in different languages based on the user's chosen language (manual translation is preferred for accuracy).

| Content      | Explanation                                                      |
| ------------ | ---------------------------------------------------------------- |
| Answer       | Multiple answers can be chosen randomly.                         |
| Buttons      | Display text and click actions (text, event, link).              |
| Text Button  | Returns text on click.                                           |
| Link Button  | Opens a link on click.                                           |
| Event Button | Triggers various actions: ignore, interrupt, start, end, awaken. |

| Event Types     | Explanation                                                                        |
| --------------- | ---------------------------------------------------------------------------------- |
| Ignore Event    | Displays text only; the event is ignored by DMflow.                                |
| Interrupt Event | Jumps to another scene.                                                            |
| Start Event     | Returns to the main scene.                                                         |
| End Event       | Ends the session.                                                                  |
| Awaken Event    | In listening mode, this button awakens the bot without needing a wake-up sentence. |

| Interaction Type     | Explanation                                                  |
| -------------------- | ------------------------------------------------------------ |
| Await User Response  | Ends the node and waits for the user's reply.                |
| Interrupt Activation | Restarts from the beginning if the next node fails to match. |

**Scenario Node**

| Content        | Explanation                                                                                                                                                                                                         |
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Interrupt      | Pauses the current scene and calls another; resumes the original scene after completion.                                                                                                                            |
| Restart        | Restarts the scene process.                                                                                                                                                                                         |
| Return to Main | Returns to the main scene.                                                                                                                                                                                          |
| Complete       | Automatically called upon node completion, except in branch fallbacks. To avoid fallback messages, follow with a complete node.                                                                                     |
| End Process    | Directly ends the process.                                                                                                                                                                                          |
| Listen         | The bot only receives messages; if a message matches a sub-process, it continues until a wake-up sentence is heard. Sub-processes often use resource nodes, enabling cross-channel chatting or resource monitoring. |
| Jump           | Directly jumps to another reply node (must check "await user response").                                                                                                                                            |

**Call Nodes**

These nodes are mostly API calls provided by the product. Currently available options include:

* Domain Call
* Event Registration (broadcast registration)
* Event Registration Cancellation (broadcast cancellation)
* Account Linking (link accounts to DMflow\.chat)
* Live Support

**Variable Nodes**

These nodes inject parameters into labels, user data, and single-session storage.


---

# Agent Instructions: 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:

```
GET https://docs-en.dmflow.chat/chatbot/flow.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
