Alchemy RecipeIntermediateautomation

Technical specifications extraction from product requirements

Published

Product requirements documents (PRDs) are supposed to guide development, but they're often written in natural language that's difficult for engineers to parse at scale. When you're managing dozens of products or features, manually extracting technical specifications becomes a bottleneck. Teams spend hours copying requirements into spreadsheets, reformatting them for different systems, and hunting for missing details that should have been captured upfront....... For more on this, see Product specification extraction and bill of materials ge....

The real problem isn't the tools; it's the handoff. Someone reads the PRD, someone else extracts specs, a third person validates them, and a fourth enters them into your system. Each handoff introduces delays and errors. What if that entire workflow ran automatically, triggered the moment a PRD landed in your system?

This Alchemy recipe shows you how to combine Bhava AI, ParSpec AI, and SourceAI with a workflow orchestrator to turn unstructured product requirements into validated technical specifications without touching a keyboard. You'll set up a fully automated pipeline that extracts requirements, generates technical specs, and validates them against your codebase, all while you focus on what actually matters.

The Automated Workflow

Overview of the approach

We're building a three-stage pipeline. Stage one uses Bhava AI to parse the PRD and identify core requirements. Stage two feeds those requirements into ParSpec AI to generate detailed technical specifications. Stage three uses SourceAI to validate those specs against your existing code patterns and identify potential conflicts. The entire flow triggers automatically when a new PRD is uploaded.

For orchestration, we'll use n8n because it handles complex branching logic well and gives you full visibility into each step. The workflow is equally viable in Zapier or Make, though the configuration differs slightly.

Setting up the trigger and initial parsing

The workflow starts with a file upload trigger. In n8n, configure a webhook that listens for POST requests containing the PRD document. Your teams could upload via a simple web form, a Slack command, or directly from your document management system.


POST /webhook/prd-intake
Content-Type: multipart/form-data

{
  "file": <binary>,
  "product_id": "PROD-2024-001",
  "urgency": "high"
}

Once the file arrives, convert it to plain text. If you're dealing with PDFs, use a standard PDF-to-text library or a simple CURL call to an extraction service. Store the text in a workflow variable for the next stage.


const fs = require('fs');
const pdfParse = require('pdf-parse');

async function extractText(filePath) {
  const dataBuffer = fs.readFileSync(filePath);
  const data = await pdfParse(dataBuffer);
  return data.text;
}

Stage 1: Requirements extraction with Bhava AI

Bhava AI's primary strength is natural language understanding. It can parse messy product requirements and identify structured requirements across functional, non-functional, and edge-case categories. Send the extracted text to Bhava's API endpoint:


POST https://api.bhava-ai.com/v1/extract-requirements
Authorization: Bearer YOUR_BHAVA_API_KEY
Content-Type: application/json

{
  "text": "<full PRD text from previous step>",
  "document_id": "PROD-2024-001",
  "categories": ["functional", "non-functional", "compliance", "performance"],
  "output_format": "json"
}

Bhava returns a structured JSON object with requirements grouped by category:

{
  "document_id": "PROD-2024-001",
  "requirements": [
    {
      "id": "REQ-001",
      "category": "functional",
      "requirement": "System must support OAuth 2.0 authentication",
      "priority": "high",
      "acceptance_criteria": [
        "Support Google and GitHub providers",
        "Implement token refresh mechanism",
        "Redirect to login on 401 response"
      ]
    },
    {
      "id": "REQ-002",
      "category": "performance",
      "requirement": "API endpoints must respond within 200ms at p99",
      "priority": "high",
      "metrics": {
        "target_latency_ms": 200,
        "percentile": 99,
        "sample_size": "1000 requests"
      }
    }
  ],
  "extraction_confidence": 0.94
}

In n8n, store this response in a variable and use the extraction_confidence score to decide whether to proceed. If confidence drops below 0.85, route the workflow to a human reviewer instead.

Stage 2: Technical specification generation with ParSpec AI

Now that you have structured requirements, feed them to ParSpec AI. This tool specialises in converting requirements into implementable technical specifications, including API contracts, database schemas, and integration points.


POST https://api.parspec-ai.com/v1/generate-specs
Authorization: Bearer YOUR_PARSPEC_API_KEY
Content-Type: application/json

{
  "requirements": [
    {
      "id": "REQ-001",
      "requirement": "System must support OAuth 2.0 authentication",
      "acceptance_criteria": [
        "Support Google and GitHub providers",
        "Implement token refresh mechanism",
        "Redirect to login on 401 response"
      ]
    }
  ],
  "context": {
    "technology_stack": ["Node.js", "React", "PostgreSQL"],
    "existing_patterns": "rest_api",
    "api_version": "v2"
  },
  "output_format": "openapi3"
}

ParSpec returns detailed technical specifications in OpenAPI 3.0 format:

{
  "openapi": "3.0.0",
  "info": {
    "title": "Authentication Service",
    "version": "1.0.0"
  },
  "paths": {
    "/auth/oauth/callback": {
      "get": {
        "summary": "OAuth 2.0 callback handler",
        "parameters": [
          {
            "name": "code",
            "in": "query",
            "required": true,
            "schema": {"type": "string"}
          },
          {
            "name": "provider",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": ["google", "github"]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "access_token": {"type": "string"},
                    "refresh_token": {"type": "string"},
                    "expires_in": {"type": "integer"}
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

In your n8n workflow, parse this response and store the OpenAPI spec. You'll use it in the next stage to validate against your actual codebase.

Stage 3: Validation with SourceAI

SourceAI compares your generated specifications against your actual source code and existing API implementations. This catches gaps and inconsistencies early. Connect to your repository (GitHub, GitLab, or Bitbucket) and pass both the generated specs and a snapshot of your code:


POST https://api.sourceai-validator.com/v1/validate-specs
Authorization: Bearer YOUR_SOURCEAI_API_KEY
Content-Type: application/json

{
  "generated_spec": {
    "openapi": "3.0.0",
    "paths": {
      "/auth/oauth/callback": {
        "get": {
          "parameters": [
            {"name": "code", "in": "query", "required": true},
            {"name": "provider", "in": "query", "required": true}
          ]
        }
      }
    }
  },
  "codebase_snapshot": {
    "repository": "github.com/yourorg/yourrepo",
    "branch": "main",
    "paths": [
      "src/api/auth.js",
      "src/middleware/oauth.js"
    ]
  },
  "validation_rules": [
    "endpoint_exists",
    "parameter_match",
    "response_schema_match",
    "authentication_method_match"
  ]
}

SourceAI returns a validation report:

{
  "validation_status": "partial_match",
  "matches": [
    {
      "spec_path": "/auth/oauth/callback",
      "code_path": "src/api/auth.js:handleOAuthCallback",
      "status": "implemented",
      "confidence": 0.92
    }
  ],
  "gaps": [
    {
      "requirement": "Support GitHub provider",
      "status": "not_implemented",
      "suggested_file": "src/middleware/oauth.js",
      "recommendation": "Add github provider case to oauth.js"
    }
  ],
  "conflicts": []
}

Routing and final output

At this point, your workflow has three pieces of information: extracted requirements, generated specs, and validation results. Create a conditional routing branch:

  1. If validation status is "full_match", automatically create a GitHub issue with the approved specifications and send a Slack notification to your engineering lead.

  2. If validation status is "partial_match", generate a report highlighting the gaps and route it to a technical lead for review before creating the issue.

  3. If validation status is "conflict", stop the workflow and send an alert. A conflict means the new requirements contradict existing code or architecture decisions.

For the "full_match" scenario, use the GitHub API to create an issue:


POST https://api.github.com/repos/YOUR_ORG/YOUR_REPO/issues
Authorization: token YOUR_GITHUB_TOKEN
Content-Type: application/json

{
  "title": "Technical Specs: PROD-2024-001",
  "body": "# Technical Specifications\n\n

## Requirements\n$(requirements_json)\n\n

## OpenAPI Specification\n$(openapi_spec)\n\n

## Validation Results\n$(validation_report)",
  "labels": ["spec", "ready-to-implement"],
  "assignee": "tech-lead-username"
}

For the "partial_match" scenario, send an interactive Slack message to your technical lead:

{
  "channel": "#product-specs",
  "blocks": [
    {
      "type": "section",
      "text": {
        "type": "mrkdwn",
        "text": "*New PRD Specs Ready for Review*\n\nProduct: PROD-2024-001\nValidation: Partial Match (92% complete)\n\n*Gaps Found:* 3"
      }
    },
    {
      "type": "actions",
      "elements": [
        {
          "type": "button",
          "text": {"type": "plain_text", "text": "Review & Approve"},
          "value": "approve_spec_001",
          "action_id": "approve_spec_action"
        },
        {
          "type": "button",
          "text": {"type": "plain_text", "text": "Send Back for Revision"},
          "value": "revise_spec_001",
          "action_id": "revise_spec_action"
        }
      ]
    }
  ]
}

When your lead clicks "Review & Approve", n8n listens for the Slack action callback and automatically creates the GitHub issue.

The Manual Alternative

If you prefer to keep more control over the process, you can run each tool independently and review outputs before moving to the next stage. Use Bhava AI's web dashboard to manually review extracted requirements, then export as JSON. Copy that JSON into ParSpec AI's interface, review the generated specs, and finally upload both to SourceAI's validation dashboard. This approach trades automation for visibility, which makes sense if you're testing the workflow for the first time or if your PRDs are highly unusual.

You could also skip SourceAI entirely and have your engineering lead review specs manually against the codebase. This slows the process but removes the dependency on a third tool and gives you a chance to catch nuanced architectural concerns that an AI validator might miss.

Pro Tips

Error handling and retries

Bhava's extraction confidence score can dip below 0.85 on poorly formatted PDFs or handwritten notes. Instead of failing silently, route low-confidence extractions to a queue and notify your team. You might also implement a retry with document pre-processing: convert PDFs to high-quality images and run OCR before extraction. This adds 30 seconds per document but raises confidence from 0.82 to 0.91 on difficult source material.

Rate limiting and cost control

All three APIs have rate limits. Bhava allows 1000 requests per hour; ParSpec allows 500; SourceAI allows 200. If you're running this workflow across dozens of PRDs, queue them and stagger submissions. Use n8n's built-in rate limiter node to space requests across 30 second intervals. This costs nothing extra and avoids hitting 429 errors.

Caching generated specifications

If the same requirement appears across multiple PRDs, you're regenerating the same specs repeatedly. Implement a simple cache layer in n8n: before calling ParSpec AI, check if you've already generated specs for this exact requirement. Store successful outputs in a JSON file or database table keyed by requirement text hash. Hit rates typically reach 15-20% for organisations with product families, saving significant API costs.

Validating against multiple branches

SourceAI validates against a single branch. For teams running multiple release channels (main, staging, development), extend the workflow to validate against all three and flag if specs conflict with in-flight changes. This requires three separate validation calls but catches integration issues before they reach production.

Integrating with your existing system

Most teams store approved specs in Confluence, Notion, or a custom database. Add a final step to your workflow that formats the approved OpenAPI spec into your preferred format and POSTs it to your documentation system. Use Zapier or Make if you need to integrate with SaaS tools; use n8n if your system requires custom authentication or complex data transformation.

Cost Breakdown

ToolPlan NeededMonthly CostNotes
Bhava AIPro (10,000 requests/month)£79Includes requirement extraction and classification. Overage: £0.015 per request.
ParSpec AIStandard (5,000 requests/month)£99Generates technical specs in OpenAPI, AsyncAPI, or custom formats. Overage: £0.025 per request.
SourceAIValidator (unlimited validations)£149Validates specs against code; includes 5 connected repositories. Additional repo: £20/month.
n8nCloud Professional (20 workflow executions/month included, then £0.30 per execution)£30 + variableSelf-hosted option available for £0 upfront (infrastructure costs only).
GitHub APIStandard£0Free for public repos; private repos need paid GitHub plan (£4/month per user minimum).
SlackStandard workspace£8 per user/monthNotifications are included; no additional cost.
Total (100 PRDs/month, n8n Cloud, private repos)£454 + £30 (n8n overages)Assumes ~3 API calls per PRD; 100 workflow executions. Self-hosting n8n eliminates monthly fee but adds infrastructure cost.

This workflow pays for itself if you're processing more than eight PRDs per month in a team of three or more people. The time savings come from eliminating manual specification writing, copy-paste errors, and back-and-forth validation cycles.

More Recipes