FS-DOC-05Technical
Integration and API Spec
Document Management and Filing
[YourCompany.com] · Operations Department · Prepared by FullSpec · [Today's Date]
This document defines every integration point required to build and operate the Document Management and Filing automation. It is written for the FullSpec engineering team responsible for configuring the orchestration layer, connecting external APIs, and maintaining credential hygiene. It covers the tool inventory, per-tool auth and scope requirements, field mappings between agent handoffs, the credential store structure, and the complete error handling and retry specification. Where a field name appears in a mapping table it is given in exact monospace format matching the API or schema of the named tool.
01Tool inventory
Tool
Role in automation
Auth method
Min plan required
Used by agent
Orchestration layer
Coordinate all agent workflows, manage credentials, handle retries and routing logic
Internal service account
N/A (self-hosted or SaaS tier as selected)
All agents
Gmail
Monitor monitored inbox for new email attachments; surface attachment content to Classification Agent
OAuth 2.0 (Google Identity)
Google Workspace Business Starter or above
Agent 1
DocuSign
Receive webhook event when an envelope status changes to Completed; retrieve signed document binary
OAuth 2.0 (JWT grant) + webhook HMAC
DocuSign Business Pro or eSignature API plan
Agent 1
Google Drive
Upload classified and renamed documents to the correct subfolder; return filed document URL
OAuth 2.0 (Google Identity)
Google Workspace Business Starter or above
Agent 2
Notion
Create a new row in the document register database for each successfully filed document
Notion Integration Token (Bearer)
Notion Plus or above (API access required)
Agent 2
Slack
Post confirmation notification to document owner; post exception alert to Operations Coordinator for unclassified documents
Slack Bot OAuth Token (xoxb-)
Slack Pro or above (Bot token scopes)
Agent 2
Before you connect anything: sandbox-test every integration in a non-production environment before any production credentials are entered. Use Gmail test accounts, a DocuSign sandbox organisation, a staging Google Drive shared drive, a duplicate Notion workspace, and a private Slack channel. Production credentials must not appear in any test workflow, log, or version-controlled file.
02Per-tool integration detail
Gmail
The automation uses the Gmail API in push-notification mode (Gmail watch) rather than polling. A watch is registered on the monitored mailbox and Google publishes new message notifications to a configured Pub/Sub topic. The orchestration layer subscribes to that topic and fetches the relevant message and attachment on each notification.
Auth method
OAuth 2.0 with offline access (refresh token stored in credential store). Service account delegation is supported if a Workspace admin prefers not to use a personal OAuth grant.
Required scopes
https://www.googleapis.com/auth/gmail.readonly | https://www.googleapis.com/auth/gmail.labels | https://www.googleapis.com/auth/pubsub
Webhook / trigger setup
Call users.watch on the target mailbox with a labelIds filter of ["INBOX"]. Set topicName to the provisioned Cloud Pub/Sub topic. The watch expires after 7 days; the orchestration layer must call users.watch again before expiry via a scheduled renewal job (recommend every 5 days).
Required configuration
GMAIL_MONITORED_ADDRESS stored in credential store. Pub/Sub topic ARN stored as GMAIL_PUBSUB_TOPIC. Label filter list stored as GMAIL_LABEL_FILTER (default: INBOX). Do not hardcode any of these values.
Rate limits
Gmail API: 250 quota units/second per user; users.messages.get costs 5 units. At 120 documents/month (~4/day) throttling is not required. Implement exponential backoff on 429 responses regardless.
Constraints
Attachments larger than 25 MB cannot be retrieved via the standard messages.get attachment endpoint; use the attachment ID with messages.attachments.get for any file over 5 MB. Only process parts with a non-empty filename and a MIME type in the allowed list (application/pdf, application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document, image/png, image/jpeg).
// Trigger input
Pub/Sub push message -> { messageId, historyId, emailAddress }
// Fetched from Gmail API
messages.get(userId, messageId, format='full') -> { payload.headers[], payload.parts[] }
// Output to Classification Agent
{ message_id, from_address, subject, received_at, attachment_filename, attachment_mime_type, attachment_base64 }DocuSign
DocuSign delivers a webhook (Connect) event to the orchestration layer endpoint whenever an envelope reaches the Completed status. The orchestration layer validates the HMAC signature on every inbound request before processing. The completed document binary is then retrieved via the Envelopes API.
Auth method
OAuth 2.0 JWT grant using an RSA key pair. The integration key and private key PEM are stored in the credential store. User impersonation consent must be granted once by the DocuSign account admin before the JWT grant functions.
Required scopes
signature | impersonation
Webhook / trigger setup
Configure a DocuSign Connect listener in the DocuSign admin console pointing to the orchestration layer inbound endpoint (DOCUSIGN_WEBHOOK_URL in credential store). Enable HMAC signature with the secret stored as DOCUSIGN_HMAC_SECRET. Set trigger events to: envelope-completed. The orchestration layer must return HTTP 200 within 10 seconds or DocuSign will retry.
Required configuration
DOCUSIGN_INTEGRATION_KEY, DOCUSIGN_USER_ID, DOCUSIGN_ACCOUNT_ID, DOCUSIGN_BASE_URI (e.g. https://na4.docusign.net), DOCUSIGN_HMAC_SECRET, DOCUSIGN_RSA_PRIVATE_KEY all stored in credential store. Never hardcoded.
Rate limits
DocuSign API burst limit: 1,000 calls/hour on Business Pro. At current volume (120 envelopes/month) throttling is not required. Implement retry with backoff on 429 and 503 responses.
Constraints
Admin-level API credentials are required to configure Connect webhooks. Confirm Workspace admin access before build begins. DocuSign sandbox (demo.docusign.net) uses a separate integration key from production; maintain both in the credential store under distinct key names (DOCUSIGN_INTEGRATION_KEY_SANDBOX, DOCUSIGN_INTEGRATION_KEY_PROD).
// Inbound webhook payload (Connect event)
POST DOCUSIGN_WEBHOOK_URL
Headers: X-DocuSign-Signature-1: <hmac-sha256>
Body: { envelopeId, status:'completed', completedDateTime, sender.email, recipients.signers[] }
// Document retrieval
GET /v2.1/accounts/{accountId}/envelopes/{envelopeId}/documents/combined
-> binary PDF stream
// Output to Classification Agent
{ envelope_id, completed_at, sender_email, recipient_name, document_filename, document_mime_type, document_base64 }Google Drive
The Filing and Routing Agent uploads the renamed document binary to a pre-determined subfolder path within the organisation's shared Drive. Folder IDs for every document type and party combination are stored in a routing table held in the credential store, not resolved by name at runtime.
Auth method
OAuth 2.0 with offline access (same Google OAuth app as Gmail may be reused if scopes are merged on the same token; alternatively a dedicated service account with Drive API enabled is preferred for a shared drive).
Required scopes
https://www.googleapis.com/auth/drive.file (preferred, limits access to files created by the app) | https://www.googleapis.com/auth/drive.readonly (if folder resolution requires listing)
Webhook / trigger setup
No inbound webhook. Drive is write-only from the automation perspective. The Filing Agent calls files.create with the correct parent folder ID.
Required configuration
GDRIVE_FOLDER_ROUTING_TABLE (JSON map of document_type -> folder_id) stored in credential store. GDRIVE_ROOT_SHARED_DRIVE_ID stored in credential store. All folder IDs sourced from the Drive audit completed in Week 1. Do not resolve folders by display name at runtime.
Rate limits
Drive API: 12,000 read requests/minute per user; 12,000 write requests/minute per user. At 120 uploads/month throttling is not required. Implement retry with exponential backoff on 403 rateLimitExceeded and 500 responses.
Constraints
The shared Drive folder structure must be finalised and all folder IDs committed to the routing table before go-live. If a folder ID is not found in the routing table the agent must route to the GDRIVE_UNCLASSIFIED_FOLDER_ID and raise a Slack alert rather than creating an ad-hoc folder at runtime.
// Input from Filing Agent
{ standard_filename, document_type, party_name, document_date, document_base64, mime_type }
// Drive API call
POST https://www.googleapis.com/upload/drive/v3/files?uploadType=multipart
Metadata: { name: standard_filename, parents: [resolved_folder_id], mimeType: mime_type }
// Output
{ drive_file_id, drive_web_view_link, folder_id, uploaded_at }Integration and API SpecPage 1 of 3
FS-DOC-05Technical
Notion
After a document is successfully uploaded to Drive, the Filing and Routing Agent creates a new page in the Notion document register database. The database schema must match the field mapping table in Section 03 exactly. The Notion database ID is stored in the credential store.
Auth method
Notion Internal Integration Token (Bearer token prefixed 'secret_'). The integration must be explicitly invited to the target database page in the Notion UI by a workspace admin before the token will have access.
Required scopes
Notion integration capabilities (set during integration creation): Read content, Insert content, Update content. No user OAuth is required for an internal integration.
Webhook / trigger setup
No inbound webhook. Notion is write-only from the automation. The agent calls POST /v1/pages to create a new database entry.
Required configuration
NOTION_API_TOKEN stored in credential store. NOTION_DATABASE_ID (the document register database) stored in credential store. Database property names (column headers) must match exactly the strings defined in the field mapping table in Section 03. The Notion database schema (properties and their types) must be confirmed and locked before build.
Rate limits
Notion API: 3 requests/second average (burst to ~10). At 120 documents/month throttling is not required. Implement retry with backoff on 429 responses; Notion returns a Retry-After header that must be respected.
Constraints
Notion API version header must be set: Notion-Version: 2022-06-28. Rich text property values must not exceed 2,000 characters. The Drive web view link is stored as a URL property, not a rich text field, to enable clickable links in the database view.
// Input from Filing Agent
{ standard_filename, document_type, party_name, document_date, drive_web_view_link, drive_file_id, filed_at }
// Notion API call
POST https://api.notion.com/v1/pages
Headers: Authorization: Bearer NOTION_API_TOKEN, Notion-Version: 2022-06-28
Body: { parent: { database_id: NOTION_DATABASE_ID }, properties: { ... } }
// Output
{ notion_page_id, notion_page_url }Slack
Slack is used for two distinct message types: a confirmation notification sent to the document owner after a successful filing, and an exception alert sent to the Operations Coordinator channel when the Classification Agent cannot confidently classify a document. Both use the chat.postMessage API with the relevant channel IDs stored in the credential store.
Auth method
Slack Bot OAuth Token (xoxb- prefix). The Slack app must be installed to the workspace and the bot added to each target channel before tokens are valid for those channels.
Required scopes
chat:write | chat:write.public | files:write | channels:read | users:read.email
Webhook / trigger setup
No inbound webhook for this process. The agent posts outbound messages only. If a future enhancement adds interactive buttons (e.g. approve/reject on exception alerts) incoming webhooks or Socket Mode will be required at that stage.
Required configuration
SLACK_BOT_TOKEN stored in credential store. SLACK_CHANNEL_CONFIRMATIONS (channel ID for document owner notifications) stored in credential store. SLACK_CHANNEL_EXCEPTIONS (channel ID for Operations Coordinator exception alerts) stored in credential store. SLACK_OWNER_ROUTING_TABLE (JSON map of document_type -> Slack user ID or channel ID) stored in credential store. All channel IDs stored as Slack channel IDs (e.g. C0123ABCDEF), not display names.
Rate limits
Slack API: tier 3 methods (chat.postMessage) allow ~50 requests/minute per channel. At current volume throttling is not required. Implement retry with the Retry-After header value on 429 responses.
Constraints
The bot must be a member of every channel it posts to. Exception alert messages must include the original document file attached (files:write scope) or a direct Drive link so the Operations Coordinator can act immediately. Messages must not expose raw API tokens or internal system IDs in the message body.
// Confirmation message input
{ standard_filename, document_type, party_name, drive_web_view_link, owner_slack_user_id }
// Confirmation Slack API call
POST https://slack.com/api/chat.postMessage
{ channel: owner_slack_user_id, text: 'Filed: {standard_filename}', blocks: [...] }
// Exception alert input
{ original_filename, source: 'gmail'|'docusign', confidence_score, reason_flagged, document_base64 }
// Exception Slack API call
POST https://slack.com/api/files.upload -> attach document
POST https://slack.com/api/chat.postMessage
{ channel: SLACK_CHANNEL_EXCEPTIONS, text: 'Unclassified document requires review: {original_filename}' }03Field mappings between tools
The following tables define the exact field mappings for each agent handoff. All source and destination field names are given in the exact format used by the relevant API or internal schema. These mappings must be implemented as they appear here; any deviation requires a corresponding update to the Test and QA Plan.
Handoff A: Gmail or DocuSign to Document Classification Agent
Source tool
Source field
Destination tool
Destination field
Gmail
payload.headers[].value (name='From')
Classification Agent
from_address
Gmail
payload.headers[].value (name='Subject')
Classification Agent
email_subject
Gmail
payload.headers[].value (name='Date')
Classification Agent
received_at
Gmail
payload.parts[].filename
Classification Agent
attachment_filename
Gmail
payload.parts[].mimeType
Classification Agent
attachment_mime_type
Gmail
payload.parts[].body.attachmentId (resolved to binary)
Classification Agent
attachment_base64
DocuSign
envelopeId
Classification Agent
envelope_id
DocuSign
completedDateTime
Classification Agent
received_at
DocuSign
sender.email
Classification Agent
from_address
DocuSign
recipients.signers[0].name
Classification Agent
recipient_name
DocuSign
documents[0].name
Classification Agent
attachment_filename
DocuSign
documents combined binary
Classification Agent
attachment_base64
Handoff B: Document Classification Agent to Filing and Routing Agent
Source tool
Source field
Destination tool
Destination field
Classification Agent
document_type
Filing Agent
document_type
Classification Agent
party_name
Filing Agent
party_name
Classification Agent
document_date
Filing Agent
document_date
Classification Agent
confidence_score
Filing Agent
confidence_score
Classification Agent
attachment_filename
Filing Agent
original_filename
Classification Agent
attachment_base64
Filing Agent
document_base64
Classification Agent
attachment_mime_type
Filing Agent
mime_type
Classification Agent
from_address
Filing Agent
sender_email
Handoff C: Filing and Routing Agent to Google Drive
Source tool
Source field
Destination tool
Destination field
Filing Agent
standard_filename
Google Drive
name (file metadata)
Filing Agent
document_base64 (decoded to binary)
Google Drive
file body (multipart upload)
Filing Agent
mime_type
Google Drive
mimeType (file metadata)
Filing Agent
resolved_folder_id (from GDRIVE_FOLDER_ROUTING_TABLE)
Google Drive
parents[0]
Handoff D: Filing and Routing Agent to Notion
Source tool
Source field
Destination tool
Destination field
Filing Agent
standard_filename
Notion
properties.File Name (title property)
Filing Agent
document_type
Notion
properties.Document Type (select property)
Filing Agent
party_name
Notion
properties.Party Name (rich_text property)
Filing Agent
document_date
Notion
properties.Document Date (date property, ISO 8601)
Filing Agent
drive_web_view_link
Notion
properties.Drive Link (url property)
Filing Agent
drive_file_id
Notion
properties.Drive File ID (rich_text property)
Filing Agent
filed_at (UTC timestamp)
Notion
properties.Filed At (date property, ISO 8601)
Filing Agent
sender_email
Notion
properties.Source Address (email property)
Handoff E: Filing and Routing Agent to Slack (confirmation)
Source tool
Source field
Destination tool
Destination field
Filing Agent
standard_filename
Slack
blocks[].text (confirmation message body)
Filing Agent
document_type
Slack
blocks[].text (document type label)
Filing Agent
drive_web_view_link
Slack
blocks[].elements[].url (button link)
Filing Agent
owner_slack_user_id (from SLACK_OWNER_ROUTING_TABLE)
Slack
channel
Filing Agent
filed_at
Slack
blocks[].text (timestamp display)
Handoff F: Classification Agent to Slack (exception alert)
Source tool
Source field
Destination tool
Destination field
Classification Agent
original_filename
Slack
blocks[].text (alert message body)
Classification Agent
confidence_score
Slack
blocks[].text (confidence label)
Classification Agent
reason_flagged
Slack
blocks[].text (reason description)
Classification Agent
attachment_base64 (decoded to binary)
Slack
files.upload body
Classification Agent (constant)
SLACK_CHANNEL_EXCEPTIONS
Slack
channel
Integration and API SpecPage 2 of 3
FS-DOC-05Technical
04Build stack and orchestration
Orchestration layout
Two discrete workflows within the automation platform: one per agent. Workflow 1 covers the Document Classification Agent (trigger through metadata output). Workflow 2 covers the Filing and Routing Agent (triggered by the structured output of Workflow 1). Workflows communicate via a shared internal data bus or platform-native inter-workflow call, not by polling an external store. A single shared credential store is referenced by both workflows; no credentials are duplicated between workflow configurations.
Agent 1 trigger mechanism
Webhook (push). Gmail watch publishes a Pub/Sub notification to the orchestration inbound endpoint. DocuSign Connect POSTs a webhook event to the same endpoint on a distinct path (/webhooks/docusign). Both paths require signature validation before the workflow proceeds: Gmail Pub/Sub uses Google-signed JWT validation; DocuSign uses HMAC-SHA256 validation against DOCUSIGN_HMAC_SECRET. Any request that fails validation must be rejected with HTTP 403 and logged. No polling is used for Agent 1.
Agent 2 trigger mechanism
Workflow-internal event. Agent 2 (Filing and Routing Agent) is triggered programmatically by Agent 1 upon producing a confident classification result (confidence_score >= CLASSIFICATION_CONFIDENCE_THRESHOLD). If confidence is below threshold, Agent 1 triggers the Slack exception path instead and terminates without invoking Agent 2. The threshold value is stored as CLASSIFICATION_CONFIDENCE_THRESHOLD in the credential store (default: 0.82) and must not be hardcoded.
Gmail watch renewal
A scheduled sub-workflow (cron, every 5 days) calls users.watch to renew the Gmail push notification registration before the 7-day expiry. Renewal failure must trigger a Slack alert to SLACK_CHANNEL_EXCEPTIONS.
Credential store model
All secrets, IDs, tokens, and configuration values are held in the automation platform's native encrypted credential store. No value from the list below may appear in workflow code, step configuration fields, logs, or version-controlled files.
Credential store: all required entries
# Google / Gmail
GOOGLE_OAUTH_CLIENT_ID = '<oauth-client-id>'
GOOGLE_OAUTH_CLIENT_SECRET = '<oauth-client-secret>'
GOOGLE_OAUTH_REFRESH_TOKEN = '<offline-refresh-token>'
GMAIL_MONITORED_ADDRESS = '<monitored-inbox@yourdomain.com>'
GMAIL_PUBSUB_TOPIC = 'projects/<project-id>/topics/<topic-name>'
GMAIL_LABEL_FILTER = '["INBOX"]'
# DocuSign
DOCUSIGN_INTEGRATION_KEY_PROD = '<prod-integration-key>'
DOCUSIGN_INTEGRATION_KEY_SANDBOX= '<sandbox-integration-key>'
DOCUSIGN_USER_ID = '<api-user-guid>'
DOCUSIGN_ACCOUNT_ID = '<account-guid>'
DOCUSIGN_BASE_URI = 'https://na4.docusign.net'
DOCUSIGN_HMAC_SECRET = '<connect-hmac-secret>'
DOCUSIGN_RSA_PRIVATE_KEY = '<pem-encoded-private-key>'
DOCUSIGN_WEBHOOK_URL = 'https://<orchestration-host>/webhooks/docusign'
# Google Drive
GDRIVE_ROOT_SHARED_DRIVE_ID = '<shared-drive-id>'
GDRIVE_FOLDER_ROUTING_TABLE = '{"Invoice":{"default":"<folder-id>"},"Contract":{"default":"<folder-id>"},"HR Form":{"default":"<folder-id>"},"Compliance":{"default":"<folder-id>"},"Other":{"default":"<folder-id>"}}'
GDRIVE_UNCLASSIFIED_FOLDER_ID = '<unclassified-holding-folder-id>'
# Notion
NOTION_API_TOKEN = 'secret_<internal-integration-token>'
NOTION_DATABASE_ID = '<document-register-database-id>'
# Slack
SLACK_BOT_TOKEN = 'xoxb-<bot-token>'
SLACK_CHANNEL_CONFIRMATIONS = 'C<channel-id>'
SLACK_CHANNEL_EXCEPTIONS = 'C<exceptions-channel-id>'
SLACK_OWNER_ROUTING_TABLE = '{"Invoice":"U<finance-user-id>","Contract":"U<ops-user-id>","HR Form":"U<hr-user-id>","default":"C<channel-id>"}'
# Classification control
CLASSIFICATION_CONFIDENCE_THRESHOLD = '0.82'
# Allowed MIME types (pipe-delimited)
ALLOWED_MIME_TYPES = 'application/pdf|application/msword|application/vnd.openxmlformats-officedocument.wordprocessingml.document|image/png|image/jpeg'The GDRIVE_FOLDER_ROUTING_TABLE and SLACK_OWNER_ROUTING_TABLE values must be populated from the Drive audit output completed in Week 1 of the delivery plan. No folder IDs or user IDs should be assumed or invented during build. Confirm all IDs in writing with the operations team before the credential store is sealed for production.
05Error handling and retry logic
Every integration point in this automation has a defined failure behaviour. Unhandled exceptions must never fail silently. If a step fails and its retry policy is exhausted, the orchestration layer must post an alert to SLACK_CHANNEL_EXCEPTIONS with the document name, the step that failed, the error code, and the number of retries attempted. The document must then be placed in the GDRIVE_UNCLASSIFIED_FOLDER_ID holding area if a binary is available, or logged to a dead-letter queue if not.
Integration
Scenario
Required behaviour
Gmail (Pub/Sub inbound)
Pub/Sub push notification fails signature validation
Reject with HTTP 403. Log request origin and timestamp. Do not process. No retry. Alert to SLACK_CHANNEL_EXCEPTIONS if this occurs more than 3 times in 1 hour (possible misconfiguration or spoofing).
Gmail (attachment fetch)
messages.get or attachments.get returns 429 rate limit
Retry up to 4 times with exponential backoff: 5s, 15s, 45s, 120s. If all retries fail, post alert to SLACK_CHANNEL_EXCEPTIONS and archive message ID to dead-letter log for manual retry.
Gmail (attachment fetch)
Attachment MIME type not in ALLOWED_MIME_TYPES
Skip silently and log to audit log with message_id and detected MIME type. Do not raise a Slack alert unless the unsupported type appears more than 10 times in 24 hours.
DocuSign (inbound webhook)
HMAC signature validation fails
Reject with HTTP 403. Log payload hash and timestamp. Do not process envelope. Alert to SLACK_CHANNEL_EXCEPTIONS immediately.
DocuSign (inbound webhook)
Orchestration layer does not return HTTP 200 within 10 seconds
DocuSign will retry the webhook automatically (up to 8 times over 24 hours). The orchestration layer must accept and deduplicate replayed envelopeId values using an idempotency key store keyed on envelopeId.
DocuSign (document retrieval)
GET /envelopes/{id}/documents returns 401 or 403
Token may be expired. Attempt one silent token refresh using the JWT grant flow. If the refresh fails, retry the document retrieval once. If still failing, post alert to SLACK_CHANNEL_EXCEPTIONS and log the envelopeId for manual retrieval.
Classification Agent
Confidence score below CLASSIFICATION_CONFIDENCE_THRESHOLD
Do not invoke Filing Agent. Upload original file to GDRIVE_UNCLASSIFIED_FOLDER_ID. Post exception alert to SLACK_CHANNEL_EXCEPTIONS with filename, confidence_score, and reason_flagged. Log to Notion with status 'Pending Manual Review'.
Google Drive (file upload)
files.create returns 403 rateLimitExceeded or 500
Retry up to 3 times with exponential backoff: 10s, 30s, 90s. If all retries fail, post alert to SLACK_CHANNEL_EXCEPTIONS with document name and target folder ID. Do not discard the document binary; hold it in the orchestration layer temporary store for up to 24 hours for manual re-trigger.
Google Drive (folder routing)
document_type not found in GDRIVE_FOLDER_ROUTING_TABLE
Fall back to GDRIVE_UNCLASSIFIED_FOLDER_ID. Do not create a new folder at runtime. Post alert to SLACK_CHANNEL_EXCEPTIONS indicating the unrecognised document type so the routing table can be updated.
Notion (page creation)
POST /v1/pages returns 429 with Retry-After header
Wait for the exact value of the Retry-After header (in seconds), then retry once. If the second attempt fails, retry after 60 seconds. After 3 total attempts, post alert to SLACK_CHANNEL_EXCEPTIONS. The Drive upload is already complete; the Notion log entry is the only missing output and must be retried manually using the logged payload.
Notion (page creation)
Property name mismatch (e.g. database schema changed)
API returns 400 validation_error. Do not retry. Post alert to SLACK_CHANNEL_EXCEPTIONS with the full error body. This indicates a schema change in the Notion database that requires a credential store update and redeploy.
Slack (chat.postMessage)
API returns 429 or channel_not_found
For 429: wait for Retry-After value and retry up to 3 times. For channel_not_found: log error to orchestration audit log and do not retry until SLACK_CHANNEL_CONFIRMATIONS or SLACK_CHANNEL_EXCEPTIONS is corrected in the credential store. The underlying document operation (Drive upload, Notion log) is already complete; the Slack notification is advisory only and its failure must not roll back upstream steps.
Gmail watch renewal (scheduled)
users.watch call fails
Retry once after 30 minutes. If the second attempt fails, post alert to SLACK_CHANNEL_EXCEPTIONS immediately. Without a valid watch the Gmail trigger will stop functioning. Manual renewal via the Google API console is required if automated renewal fails twice consecutively.
Unhandled exceptions must never fail silently. Any code path that catches a generic exception must still write a structured log entry (timestamp, workflow ID, step name, error code, document identifier) and attempt the Slack alert. If the Slack alert itself fails, write the alert payload to the orchestration platform's internal error log where it can be retrieved by the FullSpec team. Contact support@gofullspec.com for any production error that cannot be resolved within one business day.
Integration and API SpecPage 3 of 3