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

# How AI diagram generation works in Just Flow It

> Understand how Just Flow It transforms text, voice, photos, and PDFs into valid BPMN 2.0 diagrams — and how to get the best results from the AI.

The core of Just Flow It is an AI pipeline that takes a description of a business process — in any format — and produces a complete, valid BPMN 2.0 diagram. You do not need to know BPMN notation, draw anything by hand, or structure your input in a specific way. The AI reads what you give it, identifies the process steps, the people or systems involved, and the decision points, then assembles and lays out the diagram for you. This page explains how that pipeline works and how to write prompts that give you the most accurate output.

## How the AI pipeline works

<Steps>
  <Step title="You provide input">
    Just Flow It accepts four types of input interchangeably. Use whichever fits your situation:

    <Tabs>
      <Tab title="Text">
        Type a description of your process directly into the prompt box. This is the most common approach and gives the most predictable results because the AI can read your exact words.
      </Tab>

      <Tab title="Voice">
        Click the microphone icon and speak your process aloud. The AI transcribes the audio and treats it the same as typed text — useful when you think better talking than typing.
      </Tab>

      <Tab title="Photo">
        Upload a photo of a whiteboard sketch, sticky-note flow, or hand-drawn diagram. The AI interprets the visual layout and converts it into a structured BPMN diagram.
      </Tab>

      <Tab title="PDF">
        Attach a PDF — a process document, a standard operating procedure, or even a scanned paper form. The AI extracts the described process and maps it to BPMN elements.
      </Tab>
    </Tabs>
  </Step>

  <Step title="The AI structures the process">
    Behind the scenes, the AI analyses your input and extracts:

    * **Process steps** — the individual tasks and activities
    * **Roles and owners** — who or what is responsible for each step (used to create pools and lanes)
    * **Decision points** — conditions that branch the flow (used to create gateways)
    * **Start and end states** — what triggers the process and what outcomes are possible
    * **Parallel or sequential relationships** — whether steps happen one after another or simultaneously
  </Step>

  <Step title="A valid BPMN 2.0 diagram is generated">
    The structured data is converted into a standards-compliant BPMN 2.0 diagram. The AI places Start Events, Tasks, Gateways, Pools, Lanes, and End Events, then draws Sequence Flows between them. Auto-layout runs automatically so the diagram is clean and readable from the first render.
  </Step>
</Steps>

## Writing prompts that get great results

The more context you give the AI, the more accurate and detailed the diagram will be. Here are the most effective techniques:

<CardGroup cols={2}>
  <Card title="Name the roles" icon="user-tag">
    Mention who performs each step — "the procurement officer", "the customer", "the ERP system". These become lanes or pools in the diagram.
  </Card>

  <Card title="List the decision points" icon="code-branch">
    Describe conditions explicitly: "if approved", "otherwise", "when the stock level is below 10". These become gateways.
  </Card>

  <Card title="Specify start and end states" icon="flag">
    Tell the AI what triggers the process and what the possible outcomes are. This produces clear Start and End Events.
  </Card>

  <Card title="Mention parallel steps" icon="arrows-split-up-and-left">
    If steps happen at the same time, say so: "while the manager reviews the request, the system sends a confirmation email." The AI will use a Parallel Gateway.
  </Card>
</CardGroup>

### Prompt example

The following prompt produces a detailed, multi-lane diagram with branching logic:

```text theme={null}
A new employee onboarding process. The HR coordinator creates the employee 
profile in the HR system and sends a welcome email. At the same time, the IT 
team provisions a laptop and company accounts. Once both are complete, the 
employee attends an orientation session run by HR. 

After orientation, the line manager assigns the first-week tasks. If the 
employee is in a regulated role, the compliance team also runs a mandatory 
induction module. Once all tasks are assigned (and the induction is complete 
if applicable), the onboarding is marked as done.
```

This prompt gives the AI roles (HR coordinator, IT team, line manager, compliance team), parallel steps, a conditional branch for regulated roles, and a clear end state — all the information needed to build an accurate diagram without any manual adjustment.

<Tip>
  You do not need a polished paragraph. Bullet points, numbered lists, or even rough notes work well. The AI is designed to handle informal, conversational descriptions — not just clean technical specs.
</Tip>

## Chat-based refinement

After the initial diagram is generated, you can continue shaping it through the AI chat panel without starting over. Each message you send is applied as a targeted edit to the existing diagram — the AI understands the current state and applies your instruction in context.

Refinement examples:

* *"Add a rejection path from the approval gateway back to the request step."*
* *"Split the IT lane into Hardware and Software."*
* *"Replace the manual approval task with an automated system check."*
* *"Add a 48-hour timer to the manager review step — if no action, escalate automatically."*

<Note>
  Each message sent to the AI chat panel uses one AI prompt credit on the Free plan. Unlimited refinement is available on Pro and Team plans.
</Note>

## Complex processes

Just Flow It is built to handle processes with 20, 30, 50, or more steps without hitting a size limit or degrading in quality. For very large processes, consider a few strategies:

<Accordion title="Break the process into sub-processes">
  For processes with many steps, ask the AI to collapse a group of related tasks into a collapsed Sub-Process element. You can then expand it into its own diagram, keeping the top-level view readable. Try: *"Group the document review steps into a collapsed sub-process called 'Document Review'."*
</Accordion>

<Accordion title="Generate the process in sections">
  Describe one phase of a large process at a time, generate a diagram for each, and then describe how they connect. This is especially useful for end-to-end enterprise processes that span multiple departments.
</Accordion>

<Accordion title="Start broad, then drill down">
  Begin with a high-level description to get the overall shape, then use the chat panel to add detail to individual steps. This is often faster than trying to describe every nuance upfront.
</Accordion>

## What the AI does not do

* The AI does not access external systems, databases, or your organisation's internal tools unless you describe them in your prompt.
* On Free and Pro plans, the AI uses general language and placeholder role names. On the **Team plan**, the AI learns your organisation's terminology and uses your actual role names and department names in generated diagrams.
* The AI generates valid BPMN 2.0 structure — it does not verify whether your described process is *correct* or *efficient*. Process design decisions remain yours.

<CardGroup cols={2}>
  <Card title="BPMN Basics" icon="diagram-project" href="/concepts/bpmn-basics">
    Learn what each generated BPMN element means.
  </Card>

  <Card title="Canvas Overview" icon="object-group" href="/concepts/diagrams-and-canvas">
    Navigate the canvas and chat panel where generation and refinement happen.
  </Card>
</CardGroup>
