Back to Audit Preparation Workflow

Developer Handover Pack

Everything needed to build the automation from scratch: current state, full agent specs, data flow, and the build stack.

4 pagesPDF · Technical
FS-DOC-04Technical

Developer Handover Pack

Audit Preparation Workflow

[YourCompany.com] · Legal Department · Prepared by FullSpec · [Today's Date]

This document is the primary technical reference for the FullSpec team building the Audit Preparation Workflow automation. It covers the current-state process map, agent specifications with IO definitions, the end-to-end data flow, and the recommended build stack. Everything needed to build, connect, and test the two-agent orchestration is contained here. The compliance manager's responsibilities and the owner-facing SOP are covered in separate documents.

01Process snapshot

Step
Name
Description
1
Confirm Audit Scope and Evidence List
Compliance Manager reviews the audit brief and manually builds a required-document list in a spreadsheet or Word document, shared via email. Time cost: 90 minutes.
2
Assign Document Requests to Owners
Each evidence line item is manually assigned to an internal stakeholder via individual Gmail or Slack messages. Time cost: 60 minutes.
3
Stakeholders Upload Documents
Internal contributors locate, name, and upload assigned documents to a shared Drive folder with no enforced naming convention, causing inconsistencies. Time cost: 240 minutes. BOTTLENECK
4
Track Submission Status on Spreadsheet
Compliance Manager manually checks the Drive folder and updates a Notion/spreadsheet tracker repeatedly throughout the audit window. Time cost: 120 minutes. BOTTLENECK
5
Send Overdue Reminders
Outstanding items are identified from the tracker and the Compliance Manager manually writes and sends a reminder email to each overdue stakeholder. Time cost: 45 minutes.
6
Review Submitted Documents for Completeness
Compliance Manager opens each uploaded file to verify it matches the request, is the correct version, and covers the required date range. Incorrect files are re-requested. Time cost: 150 minutes. BOTTLENECK
7
Request Signatures on Declarations
Compliance Manager manually prepares declaration documents and routes them for signature via DocuSign per audit item type. Time cost: 30 minutes.
8
Assemble Final Evidence Pack
All verified documents are manually renamed, organised into a folder structure, and compiled. Often requires multiple rounds of reorganisation. Time cost: 120 minutes.
9
Notify Auditors and Share Access
Compliance Manager emails the external auditor with access details or shares the Drive folder, then notifies internal leadership. Time cost: 20 minutes.
Time cost summary: Total manual time per audit cycle is 875 minutes (approximately 14.6 hours). At an assumed frequency of 2 to 4 cycles per year and ongoing tracker maintenance between cycles, this equates to approximately 11 hours of manual work per week across the audit window. Steps 2, 4, and 5 are replaced by the Evidence Collection Agent. Steps 6, 7, and 8 are replaced by the Document Review and Organisation Agent. Step 9 is replaced by an automated Slack completion alert. Steps 1 and 3 remain human-owned.
Developer Handover PackPage 1 of 4
FS-DOC-04Technical

02Agent specifications

Evidence Collection Agent

Monitors the Notion audit record from the moment it is created, generates the structured evidence checklist, dispatches personalised assignment emails via Gmail, creates the Drive submission folder hierarchy, and runs a daily status-monitoring loop that fires overdue alerts through both Slack and Gmail when submission deadlines pass. This agent removes all manual assignment drafting and all recurring tracker-update sessions from the compliance manager's workload. It does not make pass/fail decisions on document content; that responsibility sits with the Document Review and Organisation Agent.

Trigger
New audit record created in Notion with a confirmed engagement date and audit scope field populated.
Tools
Notion, Gmail, Slack, Google Drive
Replaces steps
Step 2 (Assign Document Requests), Step 4 (Track Submission Status), Step 5 (Send Overdue Reminders)
Estimated build
22 hours | Moderate complexity
// Input
notion.audit_record {
  audit_id: string,          // unique record ID
  audit_type: enum,          // e.g. 'SOC2' | 'ISO27001' | 'Financial'
  engagement_date: date,     // confirmed audit start date
  internal_deadline: date,   // evidence submission cutoff
  assigned_owner: string,    // compliance manager name
  stakeholder_list: array    // [{name, email, slack_id, doc_items[]}]
}

// Output
notion.checklist_record[] {
  item_id: string,
  document_name: string,
  assigned_to: string,
  due_date: date,
  status: enum  // 'pending' | 'received' | 'overdue' | 'verified'
}
gmail.assignment_email {
  to: stakeholder_email,
  subject: 'Audit Evidence Request: [document_name]',
  body: personalised_template  // includes doc name, format, internal_deadline
}
google_drive.folder {
  folder_name: 'Audit_[audit_id]_[engagement_date]',
  subfolders: [audit_type categories],
  permissions: per_stakeholder_email
}
slack.overdue_alert {
  channel: stakeholder_slack_id,
  message: 'Reminder: [document_name] is overdue. Deadline was [due_date].'
}
gmail.overdue_email {
  to: stakeholder_email,
  subject: 'Action Required: Overdue Audit Submission',
  body: overdue_reminder_template
}
  • Notion API tier: The workspace must be on a plan that exposes database API access (Business or Enterprise). Confirm before build. The checklist database schema must be finalised and locked before the agent is connected; mapping against an ad-hoc schema will cause field-resolution errors.
  • Gmail sender: Use a shared compliance inbox (e.g. compliance@[YourCompany.com]) authenticated via OAuth 2.0 with the gmail.send scope. Do not use a personal account; alias sending must be enabled in Google Workspace settings.
  • Slack workspace permissions: The bot token requires chat:write and users:read.email scopes to resolve stakeholder Slack IDs from email addresses in the stakeholder_list array.
  • Drive folder creation: The integration must have drive.file scope at minimum. Confirm the automation platform supports Drive folder-level create and share operations. If only polling is available (no webhook at this stage), set the monitoring loop interval to every 6 hours during active audit windows.
  • Overdue logic: An item is overdue when current_date > due_date AND status != 'received' AND status != 'verified'. Send a maximum of three automated reminders per item (day 0 of overdue, day 2, day 5) before escalating a Slack alert to the compliance manager directly.
  • Dedupe: The trigger must check for an existing checklist linked to the same audit_id before creating a new one. If a record already exists, update rather than duplicate.
  • Stakeholder list population: If the audit_type field does not map to a known template, pause and send a Slack alert to the compliance manager to manually populate line items before assignment emails are sent.
Document Review and Organisation Agent

Watches the audit submission folder in Google Drive for new file uploads and runs each file through a validation routine: checking filename conventions, file type, and cross-referencing against the open Notion checklist items. Files that pass validation are moved to the verified sub-folder and the corresponding Notion status is updated to 'verified'. Files that require a director or department-head signature are routed automatically via DocuSign, and a completion webhook updates the checklist on return. Files that cannot be matched, are in an unexpected format, or are flagged ambiguous are queued for the compliance manager's review rather than processed automatically. Once all checklist items reach a terminal status (verified or escalated), the agent posts a completion alert to the designated Slack channel.

Trigger
New file uploaded to the audit submission folder in Google Drive (Drive webhook or polling at 6-hour intervals during active audit window).
Tools
Google Drive, Notion, DocuSign
Replaces steps
Step 6 (Review Documents for Completeness), Step 7 (Request Signatures on Declarations), Step 8 (Assemble Final Evidence Pack)
Estimated build
18 hours | Moderate complexity
// Input
google_drive.file_upload_event {
  file_id: string,
  file_name: string,
  mime_type: string,
  uploaded_by_email: string,
  parent_folder_id: string,
  upload_timestamp: datetime
}
notion.checklist_record {
  item_id: string,
  document_name: string,
  assigned_to: string,
  expected_format: string,   // e.g. 'PDF' | 'XLSX'
  requires_signature: boolean,
  signatory_email: string    // director or dept head, if requires_signature
}

// Output (validated file)
google_drive.file_move {
  file_id: string,
  destination_folder: 'Audit_[audit_id]/Verified/[category]',
  renamed_to: '[item_id]_[document_name]_v[timestamp]'
}
notion.checklist_update {
  item_id: string,
  status: 'verified',
  verified_at: datetime,
  drive_file_id: string
}

// Output (signature required)
docusign.envelope {
  envelope_id: string,
  document: drive_file_id,
  signer_email: signatory_email,
  signer_name: string,
  subject: 'Signature Required: [document_name]',
  callback_webhook_url: 'https://[automation-host]/webhook/docusign-complete'
}

// On approval (DocuSign webhook return)
docusign.envelope_completed {
  envelope_id: string,
  signed_document_url: string,
  completed_at: datetime
}
notion.checklist_update { status: 'verified', signed: true }

// Output (flagged file)
notion.checklist_update { status: 'flagged', flag_reason: string }
slack.escalation_alert {
  channel: compliance_manager_slack_id,
  message: 'File [file_name] could not be matched or validated. Manual review required.'
}

// Output (all items terminal)
slack.completion_alert {
  channel: '#compliance-alerts',
  message: 'Evidence pack for [audit_id] is complete. All items verified. Ready for auditor access.'
}
  • Drive trigger method: Prefer a Google Drive push notification (webhook) registered against the submission folder. If the automation platform does not support Drive webhooks natively, fall back to polling every 6 hours and document this limitation in the SOP.
  • File matching logic: Match uploaded files to checklist items using a combination of the uploader's email (uploaded_by_email maps to assigned_to) and a fuzzy name match against document_name. If confidence is below 80%, treat as flagged rather than auto-matched.
  • Naming convention on move: On successful validation, rename the file to the format [item_id]_[snake_case_document_name]_[YYYYMMDD] before moving to the Verified sub-folder. This must be agreed with the compliance manager before build.
  • DocuSign routing table: A mapping table of document_name to requires_signature and signatory_email must be documented and loaded as configuration before the agent is built. Routing logic differs by audit category. Agree this table with the compliance manager before build begins.
  • DocuSign webhook: Register the completion webhook URL in the DocuSign account under Connect settings. The webhook payload must include the envelope_id and signed document download URL. Validate HMAC signature on receipt.
  • Escalation cap: If more than 30% of checklist items are flagged in a single pass, pause automated processing and alert the compliance manager via Slack before continuing. This prevents cascading mis-matches from a structural folder error.
  • Completion check: After every Notion status update, query the full checklist for the audit_id. If all items are in a terminal state (verified or human-escalated and marked resolved), fire the completion Slack alert. Do not fire if any item remains pending or overdue.
Developer Handover PackPage 2 of 4
FS-DOC-04Technical

03End-to-end data flow

Full trigger-to-output data flow for the Audit Preparation Workflow. Field names match the Notion schema and Drive folder convention agreed at schema lock.
// ============================================================
// AUDIT PREPARATION WORKFLOW  |  End-to-End Data Flow
// ============================================================

// TRIGGER
// User creates a new Notion database record with audit_type,
// engagement_date, internal_deadline, and stakeholder_list populated.
notion.database.audit_records [INSERT event]
  -> fields captured: audit_id, audit_type, engagement_date,
                       internal_deadline, assigned_owner,
                       stakeholder_list[{name, email, slack_id, doc_items[]}]

// ============================================================
// AGENT HANDOFF 1: Notion trigger -> Evidence Collection Agent
// ============================================================

// STEP 1: Generate evidence checklist in Notion
evidence_collection_agent.generate_checklist(
  input: { audit_id, audit_type, stakeholder_list, internal_deadline }
)
  -> notion.database.audit_checklist [INSERT rows]
  -> fields written: item_id, document_name, assigned_to,
                      due_date, status='pending'

// STEP 2: Send personalised assignment emails via Gmail
evidence_collection_agent.send_assignment_emails(
  input: { stakeholder_list, checklist_items[], internal_deadline }
)
  -> gmail.send()
  -> fields used: to=stakeholder_email, subject, body_template,
                   doc_items[] per stakeholder

// STEP 3: Create Drive submission folder and sub-folders
evidence_collection_agent.create_drive_structure(
  input: { audit_id, engagement_date, audit_type, stakeholder_list }
)
  -> google_drive.folders.create()
  -> folder_name: 'Audit_[audit_id]_[engagement_date]'
  -> subfolders: one per audit category from audit_type template
  -> permissions: stakeholder_email granted 'writer' per assigned subfolder

// STEP 4: Daily monitoring loop (scheduled, every 6 hours)
evidence_collection_agent.monitor_submissions(
  input: { audit_id, checklist_items[], drive_folder_id }
)
  -> google_drive.files.list(parent=drive_folder_id)
  -> cross-reference: file uploaded_by_email vs checklist assigned_to
  -> notion.checklist_update(item_id, status='received') if matched
  -> overdue_check: current_date > due_date AND status='pending'

// STEP 5: Overdue escalation (fires when overdue_check = true)
evidence_collection_agent.send_overdue_alerts(
  input: { overdue_items[], stakeholder_list }
)
  -> slack.chat.postMessage(channel=stakeholder_slack_id)
     fields: item_id, document_name, due_date, overdue_message
  -> gmail.send(to=stakeholder_email, overdue_template)
  -> reminder_count++ per item_id (max 3 before compliance_manager escalation)

// ============================================================
// AGENT HANDOFF 2: Drive upload event -> Document Review Agent
// ============================================================

// STEP 6: File validation on upload
document_review_agent.validate_file(
  input: { file_id, file_name, mime_type, uploaded_by_email,
            parent_folder_id, upload_timestamp }
)
  -> match: cross-reference file_name + uploaded_by_email vs
            notion.checklist_record { item_id, document_name,
            assigned_to, expected_format }
  -> confidence_score: fuzzy match on document_name (threshold >= 0.80)

// BRANCH A: Validated, no signature required
  IF confidence >= 0.80 AND requires_signature = false
    -> google_drive.files.move(
         file_id,
         destination='Audit_[audit_id]/Verified/[category]',
         rename='[item_id]_[document_name]_[YYYYMMDD]'
       )
    -> notion.checklist_update(
         item_id, status='verified',
         verified_at=timestamp, drive_file_id=file_id
       )

// BRANCH B: Validated, signature required
  IF confidence >= 0.80 AND requires_signature = true
    -> docusign.envelopes.create(
         document=file_id,
         signer_email=signatory_email,
         signer_name=signatory_name,
         subject='Signature Required: [document_name]',
         webhook_url='https://[automation-host]/webhook/docusign-complete'
       )
    -> notion.checklist_update(item_id, status='awaiting_signature',
         docusign_envelope_id=envelope_id)

// BRANCH C: Low confidence or format mismatch (flagged)
  IF confidence < 0.80 OR mime_type != expected_format
    -> notion.checklist_update(item_id, status='flagged',
         flag_reason='name_mismatch|format_error|no_match')
    -> slack.chat.postMessage(
         channel=compliance_manager_slack_id,
         message='File [file_name] flagged. Manual review required.'
       )

// ============================================================
// WEBHOOK RETURN: DocuSign envelope completion
// ============================================================
docusign.connect_webhook [POST /webhook/docusign-complete]
  -> payload: { envelope_id, status='completed',
                signed_document_url, completed_at }
  -> validate HMAC signature against DocuSign connect secret
  -> google_drive.files.upload(signed_document_url,
       destination='Audit_[audit_id]/Verified/[category]')
  -> notion.checklist_update(item_id, status='verified', signed=true,
       verified_at=completed_at)

// ============================================================
// COMPLETION CHECK (runs after every notion.checklist_update)
// ============================================================
document_review_agent.check_completion(
  input: { audit_id }
)
  -> query: notion.checklist WHERE audit_id=[audit_id]
  -> all items IN ('verified', 'escalated_resolved') ?
     YES -> slack.chat.postMessage(
               channel='#compliance-alerts',
               message='Evidence pack [audit_id] complete. All items verified.'
             )
     NO  -> no action, continue monitoring loop
Developer Handover PackPage 3 of 4
FS-DOC-04Technical

04Recommended build stack

Orchestration layer
A workflow automation platform with native Notion, Gmail, Slack, Google Drive, and DocuSign nodes. Build one workflow per agent: 'ECA - Evidence Collection Agent' and 'DROA - Document Review and Organisation Agent'. Store all credentials in a shared credential store within the platform so both workflows reference the same OAuth tokens. Do not hardcode credentials in workflow nodes.
Webhook configuration
Register two inbound webhooks on the automation platform: (1) a Google Drive push notification endpoint for the audit submission folder, activated after the Evidence Collection Agent creates the folder. (2) a DocuSign Connect endpoint at /webhook/docusign-complete for envelope completion events. Both endpoints must validate authenticity: Drive webhooks via the resource state header; DocuSign webhooks via HMAC-SHA256 signature using the DocuSign Connect HMAC key stored in the credential store.
Templating approach
All outbound email and Slack message bodies are stored as named templates within the orchestration layer, referenced by slug (e.g. 'assignment-email-v1', 'overdue-reminder-v2'). Template variables use double-brace syntax: {{document_name}}, {{due_date}}, {{stakeholder_name}}. Templates are version-controlled in a shared config file committed to the project repository. Do not inline message copy in workflow nodes.
Error logging
All workflow execution errors and agent exceptions are written to a Supabase table named 'workflow_errors' with columns: error_id (uuid), workflow_name (text), step_name (text), error_message (text), payload_snapshot (jsonb), created_at (timestamptz). A Slack alert fires to #automation-alerts on any entry to this table where severity = 'critical'. Non-critical warnings (e.g. fuzzy match below threshold) are logged at severity = 'warning' without a Slack alert.
Testing approach
All agent logic must be validated in a sandbox environment before connecting to production credentials. Use a dedicated Notion test database, a sandboxed Gmail alias, a Slack test workspace, a Drive test folder, and the DocuSign Developer Sandbox. Run the full end-to-end dry run described in the QA and Test Plan document using synthetic audit records before any live audit cycle. OAuth tokens for production must be provisioned separately and stored under production credential entries, never overwriting sandbox entries.
Estimated total build time
Evidence Collection Agent: 22 hours. Document Review and Organisation Agent: 18 hours. End-to-end integration testing and dry run: 8 hours. Total: 48 hours across a 4 to 5 week delivery window.
Pre-build blockers: Three items must be resolved before any build work begins. First, the Notion audit checklist database schema must be finalised and documented. Second, the DocuSign signature routing table (document type to signatory mapping) must be agreed with the compliance manager. Third, the Drive folder naming convention and category list must be locked. Building against provisional or informal configurations will require rework.
Support: For technical queries during or after the build, contact the FullSpec team at support@gofullspec.com. Include the workflow name, the affected audit_id (if live), and the error log entry from the Supabase workflow_errors table where available.
Developer Handover PackPage 4 of 4

More documents for this process

Every document generated for Audit Preparation Workflow.

Launch Plan
Operations · Owner
View
ROI and Business Case
Finance · Owner
View
Process Runbook / SOP
Operations · Owner
View
Integration and API Spec
Technical · Developer
View
Test and QA Plan
Quality · Developer
View