CORTEXFLOW · FREE FOREVER

Automation

Security Questionnaire Auto-Drafter

↓ Download workflow JSON

Import in n8n: Workflows → ⋯ → Import from file, then add your credentials. Free download with a free account.

How it works

Enterprise security teams are drowning in vendor questionnaires — this workflow turns your approved policy docs into a drafting machine with a human in the loop, so high-confidence answers ship fast and shaky ones never go out unreviewed:

  1. STEP 1 — Trigger + config + read questions — Start Drafting (a manual trigger, so it’s safe to import; swap in a Google Drive trigger for full automation) fires, CONFIG — Inputs holds every editable value, and Read Questions pulls the questionnaire rows from your Questions tab.
  2. STEP 2 — Log every question as NEW — Log NEW appends each question to the Draft Log tab with status NEW, creating the audit trail for the whole run.
  3. STEP 3 — Read knowledge base + loop — Read Knowledge Base pulls your approved security-policy Google Doc as plain text, and Loop Over Questions processes the questions one at a time so every answer gets its own agent call.
  4. STEP 4 — AI drafts the answer — Prepare Question shapes {question, category, context, question_number, knowledge_text}, then Draft Answer Agent (gpt-4o-mini with the Answer Schema Parser) drafts strictly from your knowledge text: it never invents certifications, and questions your docs don’t cover get low confidence plus needs_human. Mark DRAFTED writes the draft, confidence, and source section back to the log row.
  5. STEP 5 — Confidence gate — Confidence Check compares the score against your threshold: at or above → Mark APPROVED; below → Mark IN_REVIEW plus Send Review Request on Telegram with the question, the draft, its confidence, and its source section — reply APPROVED #<n> in Telegram to approve manually.
  6. STEP 6 — Run summary — after the loop finishes, Read Draft Log re-reads the tab, Build Run Summary counts total / auto-approved / in-review, and Final Telegram Notification sends the summary.

Status flow in Sheets: NEW → DRAFTED → APPROVED (low-confidence answers go DRAFTED → IN_REVIEW)

Set up steps

You’ll need:

  • n8n (self-hosted or cloud) — n8n.io
  • An OpenAI API key — sign up at platform.openai.com/signup, then create a key under API keys
  • A Google Workspace account — workspace.google.com; connect Google Sheets + Google Docs OAuth2 credentials in n8n, and prepare one spreadsheet with two tabs (Questions, Draft Log) plus one Google Doc holding your approved security language (SOC 2 answers, policies, certifications)
  • A Telegram bot — create one via @BotFather (/newbot), and get your chat ID from @userinfobot

Your Questions tab needs these headers (copy-paste this row; Context is optional but improves drafts):

Question # | Category | Question | Context

Your Draft Log tab needs these headers (the workflow fills them; copy-paste this row):

Timestamp | Question # | Category | Question | Draft Answer | Confidence | Source Doc | Status

Steps:

  1. Import the workflow — in n8n, Workflows → Import from File → select security-questionnaire-auto-drafter.json.
  2. CONFIG — Inputs — open the Set node and fill in:
    • COMPANY_NAME — your company name (appears in drafts)
    • QUESTIONNAIRE_SHEET_ID — the ID in your questionnaire spreadsheet’s URL
    • QUESTIONS_TAB — tab holding the questions (default: Questions)
    • KNOWLEDGE_DOC_ID — the ID in your policy doc’s URL (the doc the agent drafts from)
    • CONFIDENCE_THRESHOLD — auto-approve bar, 0–1 (default: 0.7)
    • LOG_SHEET_ID — spreadsheet ID for the draft log (can be the same sheet)
    • LOG_TAB — log tab name (default: Draft Log)
    • REVIEWER_CHAT_ID — your Telegram chat ID for review requests and the final summary
  3. Select your credentials — Google Sheets OAuth2 in Read Questions, Log NEW, Mark DRAFTED, Mark APPROVED, Mark IN_REVIEW, and Read Draft Log; Google Docs OAuth2 in Read Knowledge Base; OpenAI in GPT-4o-mini Chat Model; Telegram in Send Review Request and Final Telegram Notification.
  4. Load your data — paste the questionnaire rows into the Questions tab (headers must match exactly), and make sure your knowledge doc contains your approved security answers.
  5. Run it — click Execute on Start Drafting. Review IN_REVIEW rows in the Draft Log tab (or reply APPROVED #<n> in Telegram), then flip those rows to APPROVED in the sheet once a human signs off.

Customize it

  • Stricter or looser gating — raise CONFIDENCE_THRESHOLD to 0.9 when answers go to regulated customers; drop it to 0.5 for internal drafts where speed matters.
  • Fully automatic — replace Start Drafting with a Google Drive Trigger watching the questionnaire sheet, so new questionnaires start drafting themselves.
  • Per-framework knowledge — split the knowledge doc by framework (SOC 2, ISO 27001, GDPR) and add a routing step on Category so each question pulls the right doc.
  • Policy-gap radar — answers with needs_human=true reveal holes in your docs; log them to a separate tab and treat recurring gaps as policies to write.
  • Brand-voice pass — add a second agent after Mark APPROVED that rewrites approved answers in your company’s tone before export.
  • Feedback loop — append human-edited answers back into the knowledge doc so every review makes the next draft stronger.

Workflow nodes

This workflow is built from 18 nodes. Here's what each one does:

#NodeTypeWhat it does
1 Start Drafting Manual Trigger Lets you run the workflow manually for testing.
2 CONFIG — Inputs Set Holds editable configuration values — fill in your own settings here before activating.
3 Read Questions Google Sheets Reads from or writes to a Google Sheet — this workflow's log and state store.
4 Log NEW Google Sheets Reads from or writes to a Google Sheet — this workflow's log and state store.
5 Read Knowledge Base Google Docs Creates or updates a Google Doc.
6 Loop Over Questions Split In Batches Processes a long list of items in small batches.
7 Prepare Question Set Holds editable configuration values — fill in your own settings here before activating.
8 Draft Answer Agent AI Agent The AI brain — reasons over the task and calls tools to get it done.
9 GPT-4o-mini Chat Model OpenAI Chat Model The language model powering the AI agent.
10 Answer Schema Parser Structured Output Parser Forces the AI to return clean, structured JSON instead of free text.
11 Mark DRAFTED Google Sheets Reads from or writes to a Google Sheet — this workflow's log and state store.
12 Confidence Check IF Splits the flow into branches based on a condition.
13 Mark APPROVED Google Sheets Reads from or writes to a Google Sheet — this workflow's log and state store.
14 Mark IN_REVIEW Google Sheets Reads from or writes to a Google Sheet — this workflow's log and state store.
15 Send Review Request Telegram Sends you a Telegram message or alert.
16 Read Draft Log Google Sheets Reads from or writes to a Google Sheet — this workflow's log and state store.
17 Build Run Summary Code Runs custom JavaScript to transform, filter, or compute data between steps.
18 Final Telegram Notification Telegram Sends you a Telegram message or alert.

Setup instructions

1. Add your credentials

In n8n go to Credentials → New, create each credential below, then open the named node and select it:

NodeCredential to add
Read Questions Google Sheets OAuth2
Log NEW Google Sheets OAuth2
Read Knowledge Base Google Docs OAuth2
GPT-4o-mini Chat Model OpenAI API
Mark DRAFTED Google Sheets OAuth2
Mark APPROVED Google Sheets OAuth2
Mark IN_REVIEW Google Sheets OAuth2
Send Review Request Telegram Bot API
Read Draft Log Google Sheets OAuth2
Final Telegram Notification Telegram Bot API

2. Fill in your config values

Open the config node listed below and replace each placeholder with your own value before activating the workflow:

NodeFieldWhat to paste
CONFIG — Inputs COMPANY_NAME PASTE_YOUR_COMPANY_NAME
Your company name
CONFIG — Inputs QUESTIONNAIRE_SHEET_ID PASTE_YOUR_QUESTIONNAIRE_SHEET_ID
Your questionnaire sheet id
CONFIG — Inputs KNOWLEDGE_DOC_ID PASTE_YOUR_KNOWLEDGE_DOC_ID
Your knowledge doc id
CONFIG — Inputs LOG_SHEET_ID PASTE_YOUR_LOG_SHEET_ID
Your log sheet id
CONFIG — Inputs REVIEWER_CHAT_ID PASTE_YOUR_TELEGRAM_CHAT_ID
Your telegram chat id

How this workflow starts

  • Manual Trigger: Fires automatically on its event — activate the workflow and connect the service.

Use cases

Enterprise deals stall on security questionnaires: a prospect sends 200 questions about your SOC 2 controls, encryption, and incident response, and your team loses a week writing answers from scratch. This workflow drafts every answer from your own approved policy documents. You load the questionnaire into a Questions tab, point the workflow at the Google Doc holding your approved security language, and the Draft Answer Agent works through the questions one at a time, writing each answer strictly from your knowledge text. Every answer gets a confidence score — high-confidence drafts are auto-approved, shaky ones go to a human on Telegram, and the whole run is logged for audit.

The SaaS startup unblocking an enterprise deal

A 30-person SaaS startup gets a 180-question security questionnaire from a prospect that would take its CTO three days. The team pastes the questions into the Questions tab with categories and context, runs Start Drafting, and watches the Draft Log fill: NEW to DRAFTED to APPROVED for the questions the policy doc covers well. The run summary at the end reports total, auto-approved, and in-review counts on Telegram. Practical tip: the Context column is optional but genuinely improves drafts — paste the prospect's framing there and the agent tailors each answer instead of writing generically.

The IT services vendor in endless procurement cycles

A managed IT provider answers variations of the same questionnaire for every enterprise bid. The knowledge doc becomes the single source of truth — SOC 2 answers, policies, certifications — and every questionnaire drafts from the same approved language, so answers stay consistent across bids instead of drifting with whoever wrote them last. Practical tip: append human-edited answers back into the knowledge doc after each round, so every review makes the next draft stronger — the guide's feedback-loop suggestion turns each questionnaire into a compounding asset.

The compliance officer finding holes in the policy library

A compliance officer notices that the same questions keep coming back with needs_human set and low confidence — which is actually a signal, not a failure. Those are the policies that do not exist yet or are too vague to draft from. Logging them to a separate tab turns the workflow into a policy-gap radar: recurring gaps become the documentation backlog. Practical tip: split the knowledge doc by framework — SOC 2, ISO 27001, GDPR — and add a routing step on the Category column so each question pulls from the right doc, which lifts confidence scores across the board.

The health-tech SaaS selling to regulated customers

For a health-tech vendor, a wrong answer on a questionnaire is a liability, not just an embarrassment. The Confidence Check gate is the control: raise CONFIDENCE_THRESHOLD to 0.9 for regulated customers so only near-certain drafts auto-approve, and everything else lands IN_REVIEW with a Telegram message carrying the question, the draft, its confidence, and its source section. Approving is a Telegram reply — APPROVED with the question number — or a flip of the row in the sheet. Practical tip: the agent never invents certifications, so a question your docs do not cover gets low confidence plus needs_human instead of a confident fabrication — verify this behavior on your first run with a question you know is uncovered.

The consultancy answering questionnaires for clients

A security consultancy drafts questionnaire responses as a client service. Cloning the workflow per client — each with its own Questions tab, knowledge doc, and reviewer chat — turns a week of billable drafting into a supervised afternoon. The Draft Log tab is the audit trail the client's own auditors will ask for. Practical tip: add a second agent after the approval step that rewrites approved answers in the client's brand voice before export, so the output reads like the client wrote it, not like a template.

← All templates