Generate valid n8n workflow JSON from natural language using a scalable microservice architecture.
The AI Task Architect is a dual-backend AI application that takes natural language prompts like:
"Fetch Tesla stock price every morning and post to Slack."
and generates a valid, executable n8n workflow JSON using the OpenAI API.
- ✅ FastAPI-powered AI backend with OpenAI function calling
- ✅ NestJS Gateway with typed DTOs and error handling
- ✅ Generates clean, importable n8n workflows (
name,nodes,connections) - ✅ SQLite database integration for workflow history and reuse
- ✅ JSON structure repair, enrichment, and validation
| Layer | Tech Stack | Role |
|---|---|---|
| Frontend | HTML/JS or REST client | Sends natural prompts |
| API Gateway | NestJS (TypeScript) | Receives prompts, validates input, forwards to FastAPI |
| AI Engine | FastAPI (Python) | Generates structured workflows using GPT-4o |
| Database | SQLite via SQLAlchemy | Stores generated workflows persistently |
git clone https://github.com/niravpatidar37/ai-task-architect.git
cd ai-task-architect
cd llm_agent
python -m venv venv
source venv/bin/activate # or venv\Scripts\activate on Windows
pip install -r requirements.txt
cp .env.example .env # Add your OpenAI API Key
uvicorn main:app --reload
cd backend
npm install
npm run start:dev
# FastAPI .env
OPENAI_API_KEY=your-openai-api-key-here
POST /generate
{
"prompt": "Create a workflow that triggers every morning, fetches Tesla's stock price, and posts it to Slack."
}
Response
{
"name": "Tesla Stock Summary",
"nodes": [...],
"connections": {...}
}