20. AI Workflow Generator
The AI Workflow Generator lets you describe a business process in plain language and receive a ready-to-upload BPMN 2.0 XML file. Instead of manually writing BPMN XML or using an external modelling tool, you can let an AI model generate the workflow for you based on everything documented in this guide.
Access
Navigate to AI Workflow Generator from the sidebar (available to Managers and Administrators).
How It Works
- Select an AI Provider — Choose between Google Gemini, OpenAI (ChatGPT), or Anthropic (Claude) from the dropdown.
- Enter your API Key — Paste your personal API key for the selected provider. The key is used for this single request only — it is never stored, logged, or saved anywhere in the system.
- Describe your workflow — Write a natural language description of the business process you want (see Tips for Better Results below).
- Click "Generate Workflow" — A loading indicator appears while the AI processes your request (typically 10–30 seconds).
- Review the result — The generated BPMN XML appears in a read-only text area with a validity badge.
Supported AI Providers
| Provider | Model | What You Need |
|---|---|---|
| Google Gemini | Gemini 2.0 Flash | API key from Google AI Studio |
| OpenAI | ChatGPT | API key from OpenAI Platform |
| Claude | Anthropic Claude | API key from Anthropic Console |
Note: You bring your own API key. Workingflow does not provide API keys or charge for AI usage — billing is between you and your chosen provider.
Output Options
After generation, you have two ways to use the result — both are always available:
| Option | How | Best For |
|---|---|---|
| Copy to Clipboard | Click the "Copy to Clipboard" button below the output | Pasting into an external BPMN editor for review or manual adjustments |
| Download as .bpmn | Click the "Download .bpmn" button | Directly uploading to Workingflow via the Upload Workflow page |
XML Validity Badge
The system automatically checks whether the generated output is well-formed XML:
- ✓ Valid XML (green badge) — The output is structurally valid XML. You can download and upload it directly.
- ✗ Invalid XML (red badge) — The output has XML syntax issues. Copy the output, review it in a text editor, fix any syntax problems, and save it as a
.bpmnfile before uploading.
Important: The validity badge checks XML structure only — not BPMN business logic. After uploading, the BPMN Validation Service will check Workingflow-specific rules (known delegates, form types, assignment patterns, etc.) and report any errors or warnings.
Tips for Better Results
The AI model receives the entire Workingflow BPMN Guide as context, so it knows all supported elements, delegates, form types, and patterns. To get the best results:
-
Be specific about the process flow — Describe each step clearly:
- ❌ "Create a leave request process"
- ✅ "Create a leave request process: employee submits a form with leave type (annual/sick/personal as enum), start date, end date, and a reason (textarea). Manager reviews and approves or rejects. If rejected, employee sees the rejection reason as a label. If approved, HR is notified via email."
-
Mention assignments explicitly — Specify who should handle each task:
- "...assigned to the initiator", "...assigned to ROLE_MANAGER", "...let the user pick the reviewer using a user dropdown"
-
Reference known features by name — The AI understands Workingflow-specific terminology:
- "Use a
role_prefix dropdown for department selection" - "Add a
rule_validation for email format" - "Use the
sendReminderdelegate to email the initiator when the process ends" - "Add a non-interrupting boundary timer for escalation after 48 hours"
- "Use a
-
Specify file uploads if needed — "Include a file upload field for the receipt (accept only documents and images)"
-
Describe gateway logic — "If amount > 5000, route to director approval; otherwise, skip to final step"
Troubleshooting
| Issue | Cause | Solution |
|---|---|---|
| "Invalid API key or quota exceeded" | Wrong API key or billing issue | Verify your API key is correct and your account has credit |
| "AI service temporarily unavailable" | Provider outage | Wait a few minutes and try again, or switch to a different provider |
| "Request timed out" | Complex request or slow network | Try again; consider simplifying the description |
| "AI returned an empty response" | Model failed to generate output | Rephrase your description — be more specific or simpler |
| Invalid XML badge | AI hallucinated broken syntax | Copy the output, fix XML issues manually in a text editor |
| Valid XML but BPMN upload fails validation | AI used unsupported elements | Review the validation errors, correct the BPMN manually using this guide as reference |
Remember: AI-generated workflows are a starting point. Always review the output before deploying to production — especially gateway conditions, assignments, and delegate configurations.