EDGR can generate a full workflow from natural-language input — describe the campaign in plain English, the LLM emits a graph JSON, and the system compiles + places it on the canvas.

How it works

1

Load the prompt template

The system uses the flow-generator prompt template (stored in the workspace, customizable). See Templates.
2

Inject context

The prompt is pre-filled with:
  • Node catalog — every available node, params + output
  • Customer fields — fields you can reference via {{customer.*}}
  • Current workflow — snapshot of the existing graph (if any)
3

Call the LLM (Chat slot)

The model configured under AI Models emits a JSON graph against a strict schema.
4

Validate

The engine tries to compile the graph. On failure (cycle, missing field, invalid node id) → returns an error without applying.
5

Replace nodes + layout

Deletes every existing node on the campaign, inserts the new ones, saves a placeholder layout.
6

Auto-layout

Click “Auto-layout” on the builder header (or wait for it to fire automatically) — Dagre arranges the canvas nicely.

The customizable prompt

The flow-generator template controls how the LLM is instructed. Defaults:
  • Role: workflow architect for outbound marketing
  • Injects node catalog + customer fields
  • Injects the current workflow
  • Demands JSON output matching the schema
Orgs can override this prompt under Templates (look up template name flow-generator) to steer style (e.g. prefer short flows or email-heavy designs).

How to write a good prompt

State the goal

“3-step cold outreach for fintech leads, target 5% reply rate.”

List steps explicitly

Number each step, one per line. Don’t make the AI guess the order.

Specify branches

“If reply → handoff. If clicked but no reply → wait 5 days then follow up. If no opens after 7 days → cooldown.”

Reference variables

“Personalize subject by industry. Body cites the product use case for {{customer.country}}.”

Example prompts

3-step cold email for fintech leads in VN.
Step 1: intro mail, personalize by industry, subject < 60 chars.
Wait 3 days.
Step 2: follow-up if not opened, mention one use case from the knowledge base.
Wait 5 days.
Step 3: exit cooldown if no click. If reply at any point → handoff to sales (claim for user @binhle).

Limits & gotchas

AI Generate wipes existing nodes. If the campaign has work-in-progress, duplicate the campaign first and generate on the copy.
Long output can be truncated. The service caps maxTokens=8192 — enough for ~15 complex nodes. For larger workflows, split into multiple generate calls or build by hand.
AI Generate uses the chat slot under Settings → AI Models. You need an active Chat slot. Token cost goes against your provider key.

Review after generate

The output is a starting skeleton, not the final shape. Always review:
  1. Subject/body per messaging node — AI writes generic copy, adjust the brand voice.
  2. Replace inline body with template references for reused content.
  3. Pick specific credentials (AI inserts placeholders).
  4. Tune Wait durations for the audience’s timezone.
  5. Validate → fix compile errors.
  6. Test with 1–2 customers before activating broadly.