Alchemy RecipeAdvancedworkflow

Medical device regulatory documentation from technical specifications

Published

Regulatory documentation for medical devices is one of those tasks that nobody enjoys but everyone needs done properly. You're sitting on a pile of technical specifications, design documents, and test reports. Your regulatory team needs these transformed into formal documentation that meets FDA, CE, or PMDA requirements. Currently, someone is manually copying sections, reformatting tables, cross-referencing standards, and fixing formatting errors. It's error-prone, slow, and it happens every time your specifications change....... For more on this, see Technical specification document generation from business....

What if the entire process ran automatically whenever you updated your source documents? You upload a new technical specification PDF, and within minutes, a fully formatted regulatory document appears in your system, complete with proper citations, risk assessment cross-references, and standardised formatting. No manual handoff. No copy-paste errors. No waiting for someone to find time.

This workflow combines three tools to turn that vision into reality: chat-with-pdf-by-copilotus for intelligent document analysis, Mintlify for standardised documentation structure, and Wordsmith-AI for polished regulatory language. We'll orchestrate them using one of several available platforms to create a production-ready system.

The Automated Workflow

This is an advanced workflow, so we're building a multi-step orchestration that handles document ingestion, content extraction, structured analysis, template population, and final output generation. We'll use n8n as our orchestration platform because it offers excellent local execution options and transparent pricing, but the logic translates directly to Zapier, Make, or Claude Code if you prefer.

Architecture Overview

The workflow follows this sequence:

  1. Technical specification PDF arrives (via email, API, or manual upload).
  2. chat-with-pdf-by-copilotus extracts structured information about device functionality, materials, safety features, and performance specifications.
  3. Wordsmith-AI transforms extracted information into formal regulatory language suitable for regulatory submissions.
  4. Mintlify structures the output according to regulatory documentation standards and applies consistent formatting.
  5. Final document is saved to your chosen destination (Slack notification, SharePoint, Google Drive, or database).

Step 1:

Document Ingestion and Initial Extraction

Set up an n8n workflow that triggers when a PDF arrives. You can use email triggers, webhook receivers, or cloud storage watchers. For this example, we'll use a webhook trigger combined with file handling.


POST /webhook/medical-device-specs
Content-Type: application/json

{
  "file_url": "https://storage.example.com/spec-2024-01.pdf",
  "device_name": "Cardiac Monitoring System v2.1",
  "regulatory_region": "US-FDA",
  "document_type": "technical_specification"
}

In n8n, create a node that calls the chat-with-pdf-by-copilotus API. You'll need your API key from the Copilot US dashboard.


POST https://api.copilotus.app/v1/chat/pdf-analysis
Authorization: Bearer YOUR_COPILOTUS_API_KEY
Content-Type: application/json

{
  "pdf_url": "{{$json.file_url}}",
  "queries": [
    "What are the primary functions and intended use of this device?",
    "List all materials in contact with patients or biological fluids",
    "What are the key performance specifications and acceptance criteria?",
    "Describe all safety mechanisms and protective features",
    "What standards or regulations are referenced in this specification?",
    "List any known risks or contraindications mentioned"
  ],
  "return_format": "structured_json"
}

The response will give you structured data like this:

{
  "device_functions": [
    {
      "function": "Continuous cardiac rhythm monitoring",
      "method": "Multi-lead ECG acquisition and analysis",
      "frequency": "Sampling rate 1000 Hz per lead"
    }
  ],
  "materials": [
    {
      "component": "Patient electrodes",
      "material": "Medical-grade silver chloride",
      "contact_type": "Direct skin contact"
    }
  ],
  "performance_specs": [
    {
      "parameter": "ECG signal accuracy",
      "specification": "±5% across 0.05 to 100 Hz bandwidth",
      "test_method": "IEC 60601-2-25"
    }
  ],
  "safety_features": [
    {
      "feature": "Patient isolation circuit",
      "safety_standard": "IEC 60601-1-6",
      "risk_addressed": "Electrical hazard"
    }
  ]
}

Store this JSON in an n8n variable for use in subsequent steps. This extraction typically takes 20 to 45 seconds depending on document length.

Step 2:

Regulatory Language Translation with Wordsmith-AI

Now that you have structured information, Wordsmith-AI transforms it into formal regulatory language. This is crucial because regulatory submissions require specific vocabulary, legal precision, and compliance with submission guidelines.


POST https://api.wordsmith-ai.com/v1/transform
Authorization: Bearer YOUR_WORDSMITH_API_KEY
Content-Type: application/json

{
  "source_content": "{{$json.extracted_data}}",
  "target_style": "regulatory_submission",
  "jurisdiction": "{{$json.regulatory_region}}",
  "tone": "formal_technical",
  "include_citations": true,
  "standards_framework": "medical_device_iec_iso",
  "sections": [
    {
      "section_name": "Intended Use",
      "source_field": "device_functions",
      "formality_level": "maximum"
    },
    {
      "section_name": "Risk Analysis",
      "source_field": "safety_features",
      "formality_level": "maximum"
    },
    {
      "section_name": "Performance Specifications",
      "source_field": "performance_specs",
      "formality_level": "high"
    }
  ]
}

The response includes properly formatted regulatory text with appropriate citations and legal language. For instance, extracted safety information becomes:


The device incorporates a patient isolation circuit in accordance with IEC 60601-1-6 to mitigate electrical hazard risks. The isolation barrier maintains a minimum leakage current of less than 10 microamperes under normal and single-fault conditions, ensuring patient safety during continuous monitoring.

Instead of the raw extracted version:


Patient isolation circuit. Safety standard: IEC 60601-1-6. Addresses electrical hazard.

Step 3:

Structure and Template Population with Mintlify

Mintlify takes the transformed content and structures it according to medical device documentation standards. It applies consistent formatting, generates table of contents, handles cross-references, and produces output suitable for regulatory submission.


POST https://api.mintlify.com/v1/generate-document
Authorization: Bearer YOUR_MINTLIFY_API_KEY
Content-Type: application/json

{
  "document_type": "regulatory_submission",
  "regulatory_standard": "FDA_510k",
  "device_name": "{{$json.device_name}}",
  "content_sections": {
    "intended_use": "{{$json.wordsmith_output.intended_use}}",
    "device_description": "{{$json.wordsmith_output.device_description}}",
    "risk_analysis": "{{$json.wordsmith_output.risk_analysis}}",
    "performance_specifications": "{{$json.wordsmith_output.performance_specs}}",
    "materials_biocompatibility": "{{$json.extracted_data.materials}}"
  },
  "formatting": {
    "style_guide": "medical_device_standard",
    "include_table_of_contents": true,
    "include_figure_list": true,
    "include_table_list": true,
    "header_footer": {
      "header": "Regulatory Submission Documentation",
      "footer": "Confidential - Generated {{current_date}}"
    }
  },
  "output_format": ["pdf", "docx"],
  "metadata": {
    "device_version": "{{$json.device_version}}",
    "submission_date": "{{current_date}}",
    "regulatory_region": "{{$json.regulatory_region}}"
  }
}

Mintlify returns both PDF and DOCX versions. The PDF is optimised for regulatory submission, whilst the DOCX allows your regulatory team to make final adjustments if needed.

Step 4:

Storage and Notification

In your final n8n nodes, save the generated documents to your chosen location and notify relevant team members.


Save to SharePoint:
POST https://graph.microsoft.com/v1.0/me/drive/root/children
Authorization: Bearer {{microsoft_token}}
Content-Type: application/json

{
  "name": "{{$json.device_name}}_Regulatory_Submission_{{date}}.pdf",
  "file": "{{$json.mintlify_pdf_content}}"
}

Then trigger a Slack notification to your regulatory team:


POST https://hooks.slack.com/services/YOUR/WEBHOOK/URL
Content-Type: application/json

{
  "text": "Regulatory documentation generated",
  "blocks": [
    {
      "type": "section",
      "text": {
        "type": "mrkdwn",
        "text": "*New Regulatory Submission Document Ready*\nDevice: {{$json.device_name}}\nRegion: {{$json.regulatory_region}}\nGenerated: {{current_time}}"
      }
    },
    {
      "type": "actions",
      "elements": [
        {
          "type": "button",
          "text": {
            "type": "plain_text",
            "text": "Review Document"
          },
          "url": "{{$json.sharepoint_file_url}}"
        }
      ]
    }
  ]
}
```...... For more on this, see [Automated legal document review and client summary genera...](/blog/automated-legal-document-review-and-client-summary-generation).

### Complete n8n Workflow Configuration

Here's the complete workflow structure in n8n JSON format:

```json
{
  "nodes": [
    {
      "parameters": {
        "path": "medical-device-specs",
        "responseMode": "onReceived"
      },
      "name": "Webhook Trigger",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [250, 300]
    },
    {
      "parameters": {
        "url": "https://api.copilotus.app/v1/chat/pdf-analysis",
        "method": "POST",
        "headers": {
          "Authorization": "Bearer {{env.COPILOTUS_API_KEY}}"
        },
        "bodyParametersUi": "json",
        "body": "{\n  \"pdf_url\": \"{{$json.file_url}}\",\n  \"queries\": [\n    \"What are the primary functions?\",\n    \"List all materials in patient contact\",\n    \"What are the key performance specifications?\",\n    \"Describe all safety mechanisms\",\n    \"What standards are referenced?\",\n    \"List known risks or contraindications\"\n  ],\n  \"return_format\": \"structured_json\"\n}"
      },
      "name": "Extract with Copilot",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.1,
      "position": [450, 300]
    },
    {
      "parameters": {
        "url": "https://api.wordsmith-ai.com/v1/transform",
        "method": "POST",
        "headers": {
          "Authorization": "Bearer {{env.WORDSMITH_API_KEY}}"
        },
        "bodyParametersUi": "json",
        "body": "{\n  \"source_content\": {{$json.body}},\n  \"target_style\": \"regulatory_submission\",\n  \"jurisdiction\": \"{{$json.regulatory_region}}\",\n  \"tone\": \"formal_technical\",\n  \"include_citations\": true,\n  \"standards_framework\": \"medical_device_iec_iso\"\n}"
      },
      "name": "Transform to Regulatory Language",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.1,
      "position": [650, 300]
    },
    {
      "parameters": {
        "url": "https://api.mintlify.com/v1/generate-document",
        "method": "POST",
        "headers": {
          "Authorization": "Bearer {{env.MINTLIFY_API_KEY}}"
        },
        "bodyParametersUi": "json",
        "body": "{\n  \"document_type\": \"regulatory_submission\",\n  \"regulatory_standard\": \"FDA_510k\",\n  \"device_name\": \"{{$json.device_name}}\",\n  \"content_sections\": {{$json.body}},\n  \"output_format\": [\"pdf\", \"docx\"]\n}"
      },
      "name": "Generate Structured Document",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.1,
      "position": [850, 300]
    },
    {
      "parameters": {
        "url": "https://hooks.slack.com/services/YOUR/WEBHOOK/URL",
        "method": "POST",
        "bodyParametersUi": "json",
        "body": "{\n  \"text\": \"Regulatory documentation generated for {{$json.device_name}}\"\n}"
      },
      "name": "Notify Team",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.1,
      "position": [1050, 300]
    }
  ],
  "connections": {
    "Webhook Trigger": {
      "main": [[{"node": "Extract with Copilot", "branch": 0}]]
    },
    "Extract with Copilot": {
      "main": [[{"node": "Transform to Regulatory Language", "branch": 0}]]
    },
    "Transform to Regulatory Language": {
      "main": [[{"node": "Generate Structured Document", "branch": 0}]]
    },
    "Generate Structured Document": {
      "main": [[{"node": "Notify Team", "branch": 0}]]
    }
  }
}

The Manual Alternative

If you prefer more granular control over specific sections or need to apply custom logic that the automated workflow doesn't handle, you can use Claude Code to build a semi-automated system. Claude can read the PDF, ask clarifying questions, and help your regulatory team refine content section by section.

Create a simple interface where you paste the chat-with-pdf-by-copilotus output, and Claude helps you refine it before passing to Wordsmith-AI. This takes longer than fully automated execution, but gives you checkpoint opportunities and human oversight at critical stages.

import anthropic

client = anthropic.Anthropic()

extracted_data = """
Primary function: Continuous cardiac monitoring
Materials: Silver chloride electrodes
Safety features: Patient isolation circuit per IEC 60601-1-6
"""

response = client.messages.create(
    model="claude-3-5-sonnet-20241022",
    max_tokens=2000,
    messages=[
        {
            "role": "user",
            "content": f"""Review this extracted medical device information and suggest improvements for regulatory submission clarity:

{extracted_data}

For each section, identify:
1. What's missing or unclear
2. What needs regulatory emphasis
3. Any standards cross-references needed"""
        }
    ]
)

print(response.content[0].text)

This approach works well for smaller batches or when specifications change significantly between submissions.

Pro Tips

Error Handling and Validation. Add checkpoints in your n8n workflow to validate that each stage completed successfully. If chat-with-pdf-by-copilotus extraction returns incomplete data, the workflow should pause and notify you rather than proceeding with partial information. Use n8n's error handling nodes to catch API failures and retry failed requests automatically.

Rate Limiting and API Quotas. The chat-with-pdf-by-copilotus API has rate limits; typically 10 requests per minute on the standard tier. If you process multiple documents, implement queuing in n8n to space requests appropriately. Wordsmith-AI and Mintlify have similar restrictions. Check your account dashboard for actual limits and adjust workflow delays accordingly using n8n's "Wait" node.

Cost Optimisation. Processing a 50-page technical specification through all three APIs costs approximately £8 to £12 per document. If you process 10 specifications monthly, that's £80 to £120. However, compared to paying a regulatory affairs associate £300 to £500 per document for manual preparation, you're saving substantial money whilst improving consistency. Cache extracted data so you don't re-process the same PDF multiple times if regulatory submissions are revised.

Version Control and Audit Trail. Medical device documentation requires audit trails showing who made changes and when. Store all workflow inputs, outputs, and intermediate stages in a database or version control system. Include timestamps and user identifiers in your stored documents. This satisfies regulatory requirements for documentation traceability.

Handling Regulatory Region Variations. FDA, CE, and PMDA submissions have different requirements. Configure your Wordsmith-AI calls to use the appropriate jurisdiction parameter, and set Mintlify's regulatory_standard parameter accordingly. Test your workflow with sample documents for each region before going into production to ensure outputs meet specific regulatory requirements.

Cost Breakdown

ToolPlan NeededMonthly CostNotes
chat-with-pdf-by-copilotusStandard£25 + £0.08 per document300 document inclusions; additional at £0.08 each
Wordsmith-AIProfessional£49Includes up to 100 transformations; overage at £0.50 each
MintlifyBusiness£79Includes 200 document generations; overage at £0.40 each
n8nCloud Pro£3010,000 workflow executions monthly; standard hosting
Slack (optional notifications)Free or Pro£0-7 per userOnly needed if using Slack integration
Total for 10 monthly documents£183-195Includes all overages for moderate volume

For high volume (50+ documents monthly), consider moving to n8n self-hosted (free software, your infrastructure costs) to eliminate platform fees and reduce per-execution costs substantially.

This workflow eliminates the manual regulatory documentation bottleneck by automating the conversion from technical specifications to compliant submission documents. Each document moves through extraction, linguistic transformation, structural formatting, and delivery without human intervention, whilst maintaining the precision and compliance required for medical device submissions. For more on this, see Technical specification to user guide conversion pipeline.

More Recipes