Back to Standard Operating Procedure Management

Integration and API Spec

The reference during the build: every tool connection, auth scope, field mapping, and error-handling rule.

4 pagesPDF · Technical
FS-DOC-05Technical

Integration and API Spec

Standard Operating Procedure Management

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

This document is the definitive integration reference for the SOP Management automation. It covers every tool in the stack, the exact credentials and scopes required, field-level data mappings between agents, orchestration layout, and the full error-handling contract. It is written for the FullSpec build team and should be read alongside the Developer Handover Pack (FS-DOC-04). Nothing in this document should be actioned against a production environment until all sandbox tests have passed.

01Tool inventory

Tool
Role in automation
Auth method
Min plan required
Used by agents
Google Drive
SOP document store and file-change trigger
OAuth 2.0
Google Workspace Business Starter
Agent 1
Google Sheets
SOP register, role-to-SOP mapping table, and acknowledgement tracker
OAuth 2.0
Google Workspace Business Starter (included)
Agent 1, Agent 2
Slack
Staff notification, interactive acknowledgement buttons, reminders, escalation, and completion summary
OAuth 2.0 (bot token + signing secret)
Slack Pro or higher (for app installation)
Agent 2
DocuSign
Formal envelope signing for compliance-critical SOPs
OAuth 2.0 (JWT grant)
DocuSign Business Pro
Agent 2
Notion
Internal SOP wiki archive (read reference; no automated writes in Standard build)
Notion Integration token (internal)
Notion Plus or above for API access
Agent 2 (read only)
Automation platform (orchestration layer)
Connects all tools; hosts credential store; schedules polling and webhook listeners
Per-platform service account
Paid tier supporting webhooks and credential vaults
All agents
Before you connect anything: create dedicated sandbox or test accounts for every tool below (a test Google Workspace user, a Slack development workspace, a DocuSign sandbox account, and a Notion integration on a duplicate workspace). Validate all OAuth flows, scopes, and webhook deliveries in sandbox before any production credential is entered into the credential store.

02Per-tool integration detail

Google Drive

Monitors the approved SOPs folder for file create and modify events. Supplies file metadata (file ID, name, MIME type, last-modifying user, modified timestamp) to Agent 1. Also used by Agent 1 to write back the incremented version string to the document properties field.

Auth method
OAuth 2.0 with offline access (refresh token stored in credential store). Service account is acceptable if Drive is shared with the service account email.
Required scopes
https://www.googleapis.com/auth/drive.readonly | https://www.googleapis.com/auth/drive.file | https://www.googleapis.com/auth/drive.metadata.readonly
Webhook / trigger setup
Use the Google Drive Push Notifications API (Drive.files.watch) to register a webhook channel on the target folder ID. The channel must be renewed before its 7-day expiry; the orchestration layer must schedule a renewal job at day 6. Alternatively, the platform may poll the Drive Activity API (driveactivity.googleapis.com/v2/activity:query) at a 5-minute interval as a fallback if push channels are unavailable.
Required configuration
DRIVE_SOP_FOLDER_ID stored in credential store (never hardcoded). DRIVE_ARCHIVE_FOLDER_ID stored in credential store. File-watch channel endpoint URL registered in Drive console. Restrict trigger to MIME types: application/vnd.google-apps.document and application/pdf only.
Rate limits
Drive API: 1,000 requests/100 seconds per user; 10,000,000 requests/day. At ~12 SOP updates/month the automation makes fewer than 50 Drive API calls/day. No throttling required at current volume.
Constraints
Push notification channels expire after 7 days and must be explicitly renewed. The watch is folder-scoped; sub-folders are not watched unless explicitly included. Binary file edits (PDF overwrite) fire a modify event; the agent must detect no version-field change and skip re-processing to avoid duplicate cycles.
// Trigger payload (Drive Push Notification or poll result)
{ "kind": "drive#change",
  "fileId": "<string>",
  "file": {
    "id": "<string>",
    "name": "<string>",
    "mimeType": "<string>",
    "modifiedTime": "<ISO-8601>",
    "lastModifyingUser": { "emailAddress": "<string>", "displayName": "<string>" },
    "appProperties": { "sop_version": "<string|null>" }
  }
}
// Output written back to Drive (via files.update)
PATCH https://www.googleapis.com/drive/v3/files/{fileId}
Body: { "appProperties": { "sop_version": "<incremented_version>" } }
Google Sheets

Hosts three key data structures used across both agents: the master SOP register (Agent 1 writes), the role-to-SOP mapping table (Agent 2 reads), and the acknowledgement tracker (Agent 2 reads and writes). All sheet interactions use the Sheets v4 REST API.

Auth method
OAuth 2.0 using the same Google credentials as Drive (shared token). Scopes are additive; no second OAuth flow required if Drive and Sheets share one connected account.
Required scopes
https://www.googleapis.com/auth/spreadsheets | https://www.googleapis.com/auth/drive.readonly (for Sheets file discovery if needed)
Webhook / trigger setup
No native webhook. Agent 2 polls the acknowledgement tracker sheet on a 5-minute schedule to detect newly confirmed rows. Alternatively, a Sheets Apps Script onEdit trigger can POST to the orchestration layer webhook endpoint; document which approach is implemented in the build notes.
Required configuration
SHEETS_REGISTER_ID (spreadsheet ID of master SOP register) stored in credential store. SHEETS_REGISTER_TAB_NAME default: 'SOP Register'. SHEETS_MAPPING_TAB_NAME default: 'Role Mapping'. SHEETS_ACK_TAB_NAME default: 'Ack Tracker'. Column header row must be row 1; data begins row 2. IDs stored in credential store, never hardcoded.
Sheet structure: SOP Register
Columns A-H: sop_id | sop_name | current_version | last_revised | revised_by | change_summary | compliance_critical (TRUE/FALSE) | ack_cycle_status
Sheet structure: Role Mapping
Columns A-C: sop_id | required_role | staff_email
Sheet structure: Ack Tracker
Columns A-G: cycle_id | sop_id | sop_version | staff_email | ack_method (Slack/DocuSign) | ack_timestamp | reminder_count
Rate limits
Sheets API: 300 read requests/minute per project; 300 write requests/minute per project. At 12 SOP cycles/month with up to 30 staff each, peak write volume is well under 10 requests/minute. No throttling required at current volume.
Constraints
Sheets does not support row-level locking; if two cycles run simultaneously the append logic must use batch append (values:batchUpdate) and avoid row-index assumptions. The compliance_critical column must be populated before the first live cycle runs.
// Agent 1 append to SOP Register (spreadsheets.values.append)
POST https://sheets.googleapis.com/v4/spreadsheets/{SHEETS_REGISTER_ID}/values/'SOP Register'!A:H:append
Body: { "values": [[sop_id, sop_name, new_version, last_revised, revised_by, change_summary, compliance_critical, "open"]] }

// Agent 2 read Role Mapping (spreadsheets.values.get)
GET https://sheets.googleapis.com/v4/spreadsheets/{SHEETS_REGISTER_ID}/values/'Role Mapping'!A:C
Filter client-side: rows where col_A == sop_id

// Agent 2 write Ack Tracker row
POST .../values/'Ack Tracker'!A:G:append
Body: { "values": [[cycle_id, sop_id, sop_version, staff_email, ack_method, "", 0]] }
Slack

Used by Agent 2 for direct message notifications with interactive acknowledgement buttons, scheduled 48-hour reminders, escalation messages to line managers, and a final completion summary posted to the operations channel. Requires a custom Slack app installed in the workspace.

Auth method
OAuth 2.0 bot token (xoxb-...) stored in credential store. Signing secret stored separately in credential store for request verification on interactive payloads.
Required scopes (bot)
chat:write | chat:write.public | im:write | users:read | users:read.email | channels:read | groups:read | reactions:write | commands (if slash command fallback is implemented)
Webhook / trigger setup
Enable Interactivity in the Slack App settings. Set the Request URL to the orchestration layer's inbound webhook endpoint (HTTPS required, publicly reachable). Validate every incoming payload by computing HMAC-SHA256 of the raw request body using the signing secret and comparing it to the X-Slack-Signature header. Reject any payload where the timestamp delta exceeds 5 minutes to prevent replay attacks.
Required configuration
SLACK_BOT_TOKEN in credential store. SLACK_SIGNING_SECRET in credential store. SLACK_OPS_CHANNEL_ID (the operations summary channel) in credential store. Block Kit template for acknowledgement message stored as a JSON template with placeholders: {{sop_name}}, {{sop_version}}, {{change_summary}}, {{doc_link}}, {{cycle_id}}, {{staff_email}}.
Rate limits
Slack API Tier 3 methods (chat.postMessage): 50 requests/minute. At 12 cycles/month with max 30 recipients, burst is 30 messages per trigger. Send with a 1.2-second delay between each postMessage call to stay within rate limits. No additional throttling infrastructure required at current volume.
Constraints
Interactive components require the workspace to permit custom app installations (admin approval may be needed). Block Kit buttons must carry action_id values that encode cycle_id and staff_email so the callback handler can identify the acknowledging user without a session lookup. DMs can only be sent to users whose email matches a Slack user lookup via users.lookupByEmail.
// Outbound: acknowledgement DM (chat.postMessage)
POST https://slack.com/api/chat.postMessage
{ "channel": "<user_id>",
  "blocks": [ { "type": "section", "text": { "type": "mrkdwn",
    "text": "*SOP Updated:* {{sop_name}} v{{sop_version}}\n{{change_summary}}\n<{{doc_link}}|View document>" } },
    { "type": "actions", "elements": [ { "type": "button",
      "action_id": "ack_sop__{{cycle_id}}__{{staff_email}}",
      "text": { "type": "plain_text", "text": "I have read this SOP" },
      "style": "primary" } ] } ] }

// Inbound: interactive callback from Slack
POST <orchestration_webhook_endpoint>
Header: X-Slack-Signature: v0=<hmac_sha256>
Payload: { "type": "block_actions",
  "actions": [ { "action_id": "ack_sop__<cycle_id>__<staff_email>",
    "action_ts": "<unix_ts>" } ],
  "user": { "id": "<slack_user_id>", "name": "<slack_username>" } }
Integration and API SpecPage 1 of 3
FS-DOC-05Technical
DocuSign

Invoked by Agent 2 for compliance-critical SOPs only. Sends an envelope to required signatories, monitors envelope status via webhook, and writes completion status back to the acknowledgement tracker in Sheets. Uses the DocuSign eSignature REST API v2.1.

Auth method
OAuth 2.0 JWT Grant (server-to-server). The integration key, RSA private key, and impersonation user GUID are stored in the credential store. No browser redirect required; the automation obtains access tokens autonomously.
Required scopes
signature | impersonation | extended (extended is required for JWT impersonation consent)
Webhook / trigger setup
Register a Connect webhook (DocuSign Connect) on the DocuSign account targeting the orchestration layer's HTTPS inbound endpoint. Configure to fire on envelope events: envelope-sent, envelope-completed, envelope-declined, envelope-voided. Validate inbound payloads using the HMAC key configured in DocuSign Connect settings (X-DocuSign-Signature-1 header).
Required configuration
DOCUSIGN_INTEGRATION_KEY in credential store. DOCUSIGN_ACCOUNT_ID in credential store. DOCUSIGN_USER_GUID in credential store. DOCUSIGN_RSA_PRIVATE_KEY in credential store (PEM format). DOCUSIGN_BASE_URI (https://www.docusign.net/restapi for production; https://demo.docusign.net/restapi for sandbox). DOCUSIGN_EMAIL_TEMPLATE_ID (template GUID) stored in credential store with placeholders: {{sop_name}}, {{sop_version}}, {{doc_link}}.
Rate limits
DocuSign Business Pro: 1,000 API calls/hour. At 12 SOP cycles/month, even if all 12 are compliance-critical the envelope creation cost is 12 calls/month. No throttling required at current volume.
Constraints
JWT consent must be granted once by an account administrator before the first token request. Envelopes cannot be modified after sending; a voided envelope requires a new cycle. Signatories must have a valid email address matching the Ack Tracker staff_email field. The compliance_critical flag in Google Sheets must be set to TRUE before the cycle runs.
// Create envelope (POST /v2.1/accounts/{DOCUSIGN_ACCOUNT_ID}/envelopes)
{ "emailSubject": "Please sign: {{sop_name}} v{{sop_version}}",
  "templateId": "<DOCUSIGN_EMAIL_TEMPLATE_ID>",
  "templateRoles": [
    { "email": "<staff_email>", "name": "<staff_name>",
      "roleName": "Signer",
      "tabs": { "textTabs": [ { "tabLabel": "sop_name", "value": "{{sop_name}}" },
                               { "tabLabel": "sop_version", "value": "{{sop_version}}" } ] } }
  ],
  "status": "sent"
}

// Inbound Connect webhook payload (envelope-completed)
{ "EnvelopeStatus": { "EnvelopeID": "<guid>", "Status": "Completed",
  "Completed": "<ISO-8601>",
  "RecipientStatuses": [ { "Email": "<staff_email>", "Status": "Completed",
    "Signed": "<ISO-8601>" } ] } }
Notion

Used in the Standard build as a read reference only. Agent 2 may retrieve the Notion page URL for an archived SOP version to include in Slack messages or the SOP register. No automated writes to Notion are in scope for the Standard build. Archive writes remain a manual step for the operations manager.

Auth method
Notion Internal Integration token (secret_...) stored in credential store. The integration must be shared with the relevant Notion pages or databases by the workspace admin.
Required scopes
Read content (internal integration capability: Read content). No Insert content or Update content capability required in the Standard build.
Webhook / trigger setup
None. Notion does not offer native outbound webhooks as of the current API version. All Notion interactions are pull-based via the REST API.
Required configuration
NOTION_TOKEN in credential store. NOTION_SOP_DATABASE_ID (the Notion database GUID for the SOP archive) in credential store. The Notion database must contain a property named sop_id (text type) so the agent can look up the correct archive page by ID.
Rate limits
Notion API: 3 requests/second average; burst tolerance is limited. At 12 SOP cycles/month with one lookup per cycle, volume is negligible. No throttling required.
Constraints
The Notion integration must be manually added to each page or database it needs to read. If the SOP archive is restructured (pages moved to a different parent), the database ID in the credential store must be updated. No automated writes are in scope; any future write capability requires adding the Insert content scope and re-authorising the integration.
// Query Notion database for archive page (POST /v1/databases/{NOTION_SOP_DATABASE_ID}/query)
{ "filter": { "property": "sop_id", "rich_text": { "equals": "<sop_id>" } } }

// Response (used to extract public URL for Slack message)
{ "results": [ { "id": "<page_id>", "url": "https://www.notion.so/<page_id>",
  "properties": { "sop_id": { "rich_text": [ { "plain_text": "<sop_id>" } ] } } } ] }

03Field mappings between tools

The tables below document every field-level handoff between tools at each agent boundary. Use exact field names as shown when configuring data mappings in the orchestration layer. All monospace names are case-sensitive.

Handoff 1: Google Drive trigger to Agent 1 (SOP Version and Register Agent)

Source tool
Source field
Destination tool
Destination field
Google Drive
file.id
Google Sheets (SOP Register)
sop_id
Google Drive
file.name
Google Sheets (SOP Register)
sop_name
Google Drive
file.modifiedTime
Google Sheets (SOP Register)
last_revised
Google Drive
file.lastModifyingUser.emailAddress
Google Sheets (SOP Register)
revised_by
Google Drive
file.appProperties.sop_version
Orchestration layer (internal)
current_version (read before increment)
Orchestration layer (computed)
incremented_version
Google Drive (appProperties)
sop_version
Orchestration layer (computed)
incremented_version
Google Sheets (SOP Register)
current_version
Orchestration layer (prompt/static)
change_summary
Google Sheets (SOP Register)
change_summary

Handoff 2: Agent 1 output to Agent 2 input (Distribution and Acknowledgement Agent)

Source tool
Source field
Destination tool
Destination field
Google Sheets (SOP Register)
sop_id
Google Sheets (Role Mapping)
sop_id (lookup key)
Google Sheets (SOP Register)
sop_name
Slack message block
{{sop_name}}
Google Sheets (SOP Register)
current_version
Slack message block
{{sop_version}}
Google Sheets (SOP Register)
current_version
DocuSign envelope role tab
sop_version
Google Sheets (SOP Register)
change_summary
Slack message block
{{change_summary}}
Google Sheets (SOP Register)
compliance_critical
Orchestration layer (branch)
route_to_docusign (boolean)
Google Sheets (Role Mapping)
staff_email
Slack (users.lookupByEmail)
email (lookup param)
Google Sheets (Role Mapping)
staff_email
DocuSign envelope templateRoles
email
Google Drive (webViewLink)
webViewLink
Slack message block
{{doc_link}}
Google Drive (webViewLink)
webViewLink
DocuSign envelope templateRoles tabs
doc_link tab value

Handoff 3: Slack interactive callback to Google Sheets Ack Tracker

Source tool
Source field
Destination tool
Destination field
Slack callback payload
actions[0].action_id (parsed: cycle_id segment)
Google Sheets (Ack Tracker)
cycle_id
Slack callback payload
actions[0].action_id (parsed: staff_email segment)
Google Sheets (Ack Tracker)
staff_email
Slack callback payload
actions[0].action_ts
Google Sheets (Ack Tracker)
ack_timestamp
Orchestration layer (static)
"Slack"
Google Sheets (Ack Tracker)
ack_method
Orchestration layer (computed)
sop_version (from cycle context)
Google Sheets (Ack Tracker)
sop_version

Handoff 4: DocuSign Connect webhook to Google Sheets Ack Tracker

Source tool
Source field
Destination tool
Destination field
DocuSign Connect payload
EnvelopeStatus.EnvelopeID
Orchestration layer (cycle lookup)
envelope_id (resolve to cycle_id)
DocuSign Connect payload
RecipientStatuses[*].Email
Google Sheets (Ack Tracker)
staff_email
DocuSign Connect payload
RecipientStatuses[*].Signed
Google Sheets (Ack Tracker)
ack_timestamp
Orchestration layer (static)
"DocuSign"
Google Sheets (Ack Tracker)
ack_method
DocuSign Connect payload
EnvelopeStatus.Status
Orchestration layer (branch)
route: completed / declined / voided
Integration and API SpecPage 2 of 3
FS-DOC-05Technical

04Build stack and orchestration

Orchestration layout
Two discrete workflows, one per agent. Workflow 1: SOP Version and Register Agent. Workflow 2: Distribution and Acknowledgement Agent. Workflows are chained; Workflow 1 triggers Workflow 2 by passing the sop_id and cycle context via the shared credential store or an internal queue. A single shared credential store holds all secrets; no secret is referenced inline in workflow steps.
Workflow 1 trigger mechanism
Webhook (push). Google Drive Push Notification fires to the orchestration layer inbound endpoint when a file in the SOP folder is created or modified. The workflow validates the channel token (X-Goog-Channel-Token header) before processing. A 5-minute poll fallback using the Drive Activity API is configured as a secondary trigger in case the push channel lapses.
Workflow 2 trigger mechanism
Internal event (chained from Workflow 1). Workflow 1 emits a structured handoff payload on successful register write. Workflow 2 subscribes to this internal event and begins immediately. Secondary triggers: (a) Slack interactive component POST to the inbound webhook endpoint for acknowledgement events; (b) scheduled cron trigger every 48 hours for reminder and escalation checks; (c) DocuSign Connect webhook POST for envelope completion events.
Slack signature validation
On every inbound Slack interactive payload: compute HMAC-SHA256(SLACK_SIGNING_SECRET, 'v0:' + X-Slack-Request-Timestamp + ':' + raw_body). Compare to X-Slack-Signature header (prefix 'v0='). Reject if mismatch or if |now - X-Slack-Request-Timestamp| > 300 seconds.
DocuSign Connect validation
On every inbound DocuSign Connect payload: compute HMAC-SHA256(DOCUSIGN_CONNECT_HMAC_KEY, raw_body). Base64-encode and compare to X-DocuSign-Signature-1 header. Reject and return HTTP 401 if mismatch.
Credential store contents
See code block below. All values are referenced by key name in workflow steps. Rotation of OAuth tokens is handled automatically by the platform token refresh logic; RSA keys and static secrets require manual rotation on a schedule (minimum annually).
Environment separation
Maintain two credential store environments: SANDBOX and PRODUCTION. All development and QA work uses SANDBOX credentials exclusively. The PRODUCTION store is only activated at go-live and is access-controlled to the FullSpec build account.
Credential store keys: all values entered in the platform's secret/credential vault, never written into workflow step configurations inline
# Credential store contents (all keys required before go-live)
# Google
GOOGLE_OAUTH_CLIENT_ID          = "<oauth_client_id>"
GOOGLE_OAUTH_CLIENT_SECRET      = "<oauth_client_secret>"
GOOGLE_OAUTH_REFRESH_TOKEN      = "<refresh_token>"
DRIVE_SOP_FOLDER_ID             = "<google_drive_folder_id>"
DRIVE_ARCHIVE_FOLDER_ID         = "<google_drive_archive_folder_id>"
DRIVE_WATCH_CHANNEL_TOKEN       = "<random_uuid_for_channel_validation>"
SHEETS_REGISTER_ID              = "<google_sheets_spreadsheet_id>"
SHEETS_REGISTER_TAB_NAME        = "SOP Register"
SHEETS_MAPPING_TAB_NAME         = "Role Mapping"
SHEETS_ACK_TAB_NAME             = "Ack Tracker"

# Slack
SLACK_BOT_TOKEN                 = "xoxb-<token>"
SLACK_SIGNING_SECRET            = "<signing_secret>"
SLACK_OPS_CHANNEL_ID            = "<channel_id>"

# DocuSign
DOCUSIGN_INTEGRATION_KEY        = "<integration_key_guid>"
DOCUSIGN_ACCOUNT_ID             = "<account_id_guid>"
DOCUSIGN_USER_GUID              = "<impersonation_user_guid>"
DOCUSIGN_RSA_PRIVATE_KEY        = "-----BEGIN RSA PRIVATE KEY-----\n<pem>\n-----END RSA PRIVATE KEY-----"
DOCUSIGN_BASE_URI               = "https://www.docusign.net/restapi"
DOCUSIGN_EMAIL_TEMPLATE_ID      = "<template_guid>"
DOCUSIGN_CONNECT_HMAC_KEY       = "<connect_hmac_key>"

# Notion
NOTION_TOKEN                    = "secret_<token>"
NOTION_SOP_DATABASE_ID          = "<notion_database_guid>"

# Orchestration
INBOUND_WEBHOOK_ENDPOINT        = "https://<platform_host>/webhook/<workflow_id>"
REMINDER_INTERVAL_HOURS         = 48
ESCALATION_AFTER_REMINDERS      = 2
The DRIVE_WATCH_CHANNEL_TOKEN must be a randomly generated UUID created at build time and stored in the credential store. The orchestration layer must validate this token on every inbound Drive push notification before processing. Renewal of the Drive watch channel (7-day expiry) must be implemented as an automated maintenance workflow, not a manual task.

05Error handling and retry logic

Every integration point has a defined failure behaviour. Unhandled exceptions must never fail silently. If a step cannot complete after exhausting retries, the workflow must log the error with full context, alert the FullSpec monitoring endpoint or the operations manager via Slack, and halt the affected branch without corrupting downstream state.

Integration
Scenario
Required behaviour
Google Drive (push notification)
Push notification not received within expected window (channel lapsed or expired)
Fallback poll triggers within 5 minutes via Drive Activity API. Alert logged. Drive watch channel renewal job re-registers the channel automatically. No manual intervention required unless renewal also fails.
Google Drive (file write-back)
OAuth token expired or revoked when writing sop_version to appProperties
Attempt token refresh using stored refresh token. If refresh fails: retry once after 60 seconds, then halt Workflow 1 and post alert to SLACK_OPS_CHANNEL_ID with file ID and error detail. Do not proceed to Workflow 2.
Google Sheets (SOP Register append)
API returns 429 (rate limit) on register row append
Retry with exponential backoff: 10s, 30s, 90s (3 attempts). If all retries fail, log full error with sop_id and payload, halt workflow, and alert ops channel. Do not proceed to distribution until register write is confirmed.
Google Sheets (Role Mapping read)
sop_id not found in Role Mapping table (no matching rows returned)
Halt distribution for this cycle. Post alert to SLACK_OPS_CHANNEL_ID: 'No role mapping found for SOP <sop_id>. Update the Role Mapping tab before re-running.' Log the cycle as incomplete with reason 'mapping_missing'. Do not send Slack or DocuSign notifications.
Google Sheets (Ack Tracker write)
Concurrent write conflict or 503 on acknowledgement row update
Retry with backoff: 5s, 15s, 45s (3 attempts). Use spreadsheets.values.append (not update) to avoid row-index conflicts. If all retries fail: log the ack event with full context to a dead-letter log, alert ops channel, and flag the staff member's row as 'ack_pending_write_error' for manual reconciliation.
Slack (chat.postMessage)
Recipient email does not resolve via users.lookupByEmail (user not in workspace or deactivated)
Skip Slack DM for that staff member. Log the email as 'slack_user_not_found'. If compliance_critical is TRUE, fall through to DocuSign path regardless. Post a warning to SLACK_OPS_CHANNEL_ID listing unresolved emails. Do not silently skip.
Slack (chat.postMessage)
API returns 429 (rate limit hit when bulk-sending to large recipient list)
Implement 1.2-second delay between each postMessage call (see Section 02). If a 429 is still received: pause for the Retry-After header value, then continue the queue from the failed message. Log any message that fails after 3 retries as 'slack_send_failed' and alert ops channel.
Slack (interactive callback)
Inbound payload fails HMAC signature validation
Return HTTP 200 immediately (to prevent Slack retries) but discard the payload entirely. Log the rejected payload with timestamp and source IP. Do not update the Ack Tracker. Alert the FullSpec monitoring endpoint if rejection rate exceeds 3 in any 10-minute window.
DocuSign (envelope create)
JWT token request fails (consent not granted or RSA key mismatch)
Halt the DocuSign branch for this cycle. Post alert to SLACK_OPS_CHANNEL_ID with envelope context and error code. Do not send the envelope. Log cycle as 'docusign_auth_failure'. Manual intervention required: re-grant consent or rotate the RSA key.
DocuSign (envelope create)
Signatory email not found or invalid in DocuSign
Catch the API error (code: INVALID_EMAIL_ADDRESS_FOR_RECIPIENT). Skip that recipient, log the error with staff_email and cycle_id, and alert SLACK_OPS_CHANNEL_ID. If any signatory is skipped on a compliance-critical SOP, flag the cycle as 'incomplete_compliance' and notify the operations manager directly.
DocuSign (Connect webhook)
Connect webhook delivery fails or is not received within 2 hours of envelope-sent
Scheduled fallback: every 2 hours, poll GET /v2.1/accounts/{ACCOUNT_ID}/envelopes?from_date=<cycle_start> for envelopes in 'completed' or 'declined' status. Reconcile against Ack Tracker. Alert if any compliance-critical envelope remains open beyond the SLA window (configurable; default 48 hours).
Orchestration layer (reminder scheduler)
48-hour cron job fails to execute (platform downtime or scheduler error)
The platform must log missed executions. On recovery, the scheduler must immediately run a catch-up check against the Ack Tracker for any cycles where reminder_count is below ESCALATION_AFTER_REMINDERS and the last reminder timestamp is older than REMINDER_INTERVAL_HOURS. Do not skip reminders silently.
Dead-letter logging is mandatory for all failed Ack Tracker writes and undeliverable Slack messages. Each entry must capture: timestamp (UTC), workflow execution ID, sop_id, cycle_id, staff_email (where applicable), error code, and the full payload that failed. Dead-letter entries must be reviewed by the FullSpec team within one business day of any alert. Contact support@gofullspec.com to raise an integration failure that cannot be self-resolved.
Integration and API SpecPage 3 of 3

More documents for this process

Every document generated for Standard Operating Procedure Management.

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