WorkflowForge is a web app that converts plain English into validated n8n workflow JSON. It includes guided prompting, a massive local template library for inspiration, basic linting, and one-click export/copy.
- Install deps
npm install
- Configure environment
Create a .env
file in the project root with your Groq API key (or set it in your shell):
VITE_GROQ_API_KEY=your_groq_api_key
- Run dev server
npm run dev
Open the app at the URL shown by Vite (usually http://localhost:5173
).
- Enter a natural-language description in the prompt.
- Adjust model controls (Temperature, Max Tokens). Keep “Force JSON” on for the best validity.
- Click Generate (or press Ctrl/Cmd+Enter).
- Under the prompt, open “Templates & Context”.
- Search the local
workflows/
library and click “Add as Context” to attach a short template summary to your next generation. - Selected context snippets appear as chips. Remove a chip or click Clear to reset.
- Context guides the model and does not copy template JSON.
- Preview the graph, JSON, and node list on the right.
- Download or Copy JSON.
- If the generated workflow has a
__testPayload
, click “Test Workflow” to run a simulated test.
- Server-side validation: Zod schema validates the workflow structure.
- Self-repair: The server attempts to parse/repair JSON (JSON5) and normalize common shape issues.
- Lenient mode: If strict validation fails, the server coerces the structure and returns it with a note in
__notes
. Review in “Lints & Checks”. - Redaction: Known secret patterns are redacted in logs and sanitized in output.
- Missing trigger
- Unreachable nodes
- Nodes with no outgoing edges (info)
- Weak naming (info)
- The backend includes an
/api/import-to-n8n
endpoint that creates a workflow in your n8n instance. - UI currently copies JSON; wiring the import form (URL/API key) is trivial and can be enabled as needed.
- Vite dev server is configured with a local API middleware for
/api/*
routes. - HMR and WebSocket settings are pinned to
localhost:5173
for reliability. - The template library is built from the local
workflows/
folder at dev time. - Provider swap: The code currently pins Groq for simplicity, but it’s easy to switch to OpenAI or Claude. See
api/generate-workflow.ts
:- Replace
callGroq
with_callOpenAI
or_callClaude
(both are sketched). - Update the request body per provider.
- Change the env var to the provider’s key (e.g.,
OPENAI_API_KEY
,ANTHROPIC_API_KEY
). - In the UI, add models to
PromptInput
or expose provider selection.
- Replace
- “GROQ API error: Bad Request”: The app retries without JSON mode and then falls back to a broadly available model. Verify
VITE_GROQ_API_KEY
is set. - “Failed to generate workflow (422)”: The server returns
json_missing
orjson_invalid
with details. Enable Force JSON, reduce temperature, or add context. - WebSocket/HMR errors: Ensure nothing else is bound to port 5173; the config pins host/port.
npm run dev
– Start Vite dev servernpm run build
– Build the appnpm run preview
– Preview the production build
MIT