Skip to main content

Step 7: Configuring the Workflow (Conversation Logic)

The Workflow defines how the AI agent behaves — what it does at the start, what tools it uses, when it ends the session.

Basic Workflow Example

- process_name: SalesProcess  
name: SalesSupport
kind: StateConfig
init_state: true
description: | - Answer questions about products
- Collect contact info
- Offer call scheduling if user is interested
- Use FAQ and Knowledge Base when relevant
available_tools:
SingleStatefulOutboundAgent:
- SendChatMessage
- FinishSession
- SingleSearchFAQ

Key Workflow Components

What is StateConfig and why is it needed?

In Flametree, the AI agent follows a scenario (workflow) composed of states. Each state is described using a StateConfig block. Think of it as a set of instructions for one stage of the user interaction.

  • process_name: SalesProcess — Name of the business process (in this case, sales).

  • name: SalesSupport — Name of the current state (a step in the process).

  • kind: StateConfig — The entity type (AI agent state).

  • init_state: true — Marks this as the initial state of the scenario.

  • description — What the agent does in this step

    description: 
    | - Answer questions about hardware # The agent answers product-related questions
    - Collect contact info # Collects user contact info
    - Offer call scheduling if user is interested # Offers to schedule a call if the user is interested
    - Use FAQ and Knowledge Base when relevant # Uses FAQ and knowledge base when applicable
  • available_tools — Tools agent can use

    available_tools:    
    SingleStatefulOutboundAgent:
    - SendChatMessage # Send a message to the user
    - FinishSession # End the session
    - SingleSearchFAQ # Search the knowledge base
  • Comment highlighting in Workflow

Comments (#) in the YAML Workflow starting from the 4th character onward may not be highlighted in green. Adding the comment at the beginning of a block line restores syntax highlighting. This is a visual quirk of the editor and does not affect execution.

  • If your Workflow YAML contains a syntax error, pressing Save will cause all unsaved changes to be discarded, and the form will revert to the last valid version.

    Recommendation:

    Always check YAML validity in an external editor before saving.

Required Tools by Functionality

FunctionalityRequired Tools
Basic ChatSendChatMessage, FinishSession
Knowledge BaseSingleSearchFAQ
Operator HandoffSuggestChatMessage, TransferToTheOperatorSkill
NotificationsCustom tools for email/SMS integration