This workflow follows the Execute Workflow Trigger → HTTP Request recipe pattern — see all workflows that pair these two integrations.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"id": "aicp-deliverables",
"name": "Deliverables \u2192 Drive (rehydrated)",
"meta": {
"description": "Outbound half of the sync loop, with a human gate. Picks up tokenized deliverables agents wrote to workspace/scopes/<chain>/deliverables/, rehydrates PII via the scrubber vault (post-model), requests approval (skippable per scope via REQUIRE_APPROVAL), uploads to the scope's Drive folder, then acks so originals archive to deliverables/sent/. Attach your Google Drive OAuth2 credential to the Upload node; set the approval-gate workflow ID in the Request approval node."
},
"nodes": [
{
"parameters": {
"rule": {
"interval": [
{
"field": "minutes",
"minutesInterval": 15
}
]
}
},
"id": "ffffffff-0000-0000-0000-000000000001",
"name": "Every 15 min",
"type": "n8n-nodes-base.scheduleTrigger",
"typeVersion": 1.2,
"position": [
220,
300
]
},
{
"parameters": {
"jsCode": "const FOLDER_ID = $env.DRIVE_FOLDER_ID;\nif (!FOLDER_ID) { throw new Error('DRIVE_FOLDER_ID is not set in the n8n environment. Set it in .env and recreate the n8n container. Refusing to run against an unset Drive folder rather than querying a bogus id.'); }\n// CONFIG: which scope's deliverables ship to which Drive folder.\n// One scope -> one folder per workflow; duplicate per mapping.\n// REQUIRE_APPROVAL: true = a human must approve each batch before upload\n// (keep true for tenant-facing or pii:block scopes \u2014 shipping is a human-gated lane).\nreturn [{ json: {\n scope: 'data-team',\n folderId: FOLDER_ID,\n requireApproval: true\n} }];"
},
"id": "ffffffff-0000-0000-0000-000000000002",
"name": "Config",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
420,
300
]
},
{
"parameters": {
"method": "POST",
"url": "http://scrubber:8080/outbox",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "x-scrubber-token",
"value": "change-me-to-a-long-random-secret"
}
]
},
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={{ { \"scope\": $json.scope, \"rehydrate\": true } }}",
"options": {}
},
"id": "ffffffff-0000-0000-0000-000000000003",
"name": "Fetch outbox (rehydrated)",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
620,
300
]
},
{
"parameters": {
"jsCode": "// One item per pending deliverable, with a prebuilt multipart/related body\n// for the Drive upload API (deterministic \u2014 no node-version roulette).\nconst cfg = $('Config').first().json;\nconst files = $input.first().json.files || [];\nif (!files.length) return [{ json: { ...cfg, empty: true } }];\nconst BOUNDARY = 'deliverable-boundary-7d29';\nreturn files.map(f => {\n const meta = JSON.stringify({ name: f.filename, parents: [cfg.folderId] });\n const body = [\n `--${BOUNDARY}`,\n 'Content-Type: application/json; charset=UTF-8',\n '',\n meta,\n `--${BOUNDARY}`,\n 'Content-Type: text/plain; charset=UTF-8',\n '',\n f.text,\n `--${BOUNDARY}--`,\n ''\n ].join('\\r\\n');\n return { json: { ...cfg, filename: f.filename, restored: f.restored, uploadBody: body, boundary: BOUNDARY } };\n});"
},
"id": "ffffffff-0000-0000-0000-000000000004",
"name": "Build uploads",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
820,
300
]
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true
},
"conditions": [
{
"leftValue": "={{ $json.empty }}",
"rightValue": true,
"operator": {
"type": "boolean",
"operation": "notEquals"
}
}
]
},
"options": {}
},
"id": "ffffffff-0000-0000-0000-000000000005",
"name": "Has deliverables?",
"type": "n8n-nodes-base.if",
"typeVersion": 2.2,
"position": [
1020,
300
]
},
{
"parameters": {
"jsCode": "// Typed approval contract (G3).\nconst i = $input.first().json;\nconst c = $('Config').first().json;\nconst files = (i.uploads || i.files || []);\nconst names = files.map((f) => f.name || f.filename || '?');\n\nreturn [{ json: {\n action: `Upload ${names.length} deliverable(s) to Google Drive folder ${c.folderId || '(unset)'}`,\n scope: c.scope || 'unknown',\n riskTier: 'high',\n // Egress is the risk here: this is the point where scope content leaves the\n // controlled workspace for a third-party processor. Say that, rather than\n // making the approver infer it from the word \"upload\".\n dimensions: `egress=third-party (Google Drive), data=scope-content, reversible=no-once-shared`,\n requester: `deliverables lane (scheduled, every 15 min; requireApproval=${c.requireApproval})`,\n dataTouched: names.length ? names.join(', ') : '(no files resolved \u2014 this is itself worth rejecting)',\n preview: names.map((n, k) => `${k + 1}. ${n}`).join('\\n').slice(0, 4000) || '(empty)',\n autoApprove: false,\n} }];\n"
},
"id": "ffffffff-0000-0000-0000-000000000009",
"name": "Approval request",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
1220,
300
]
},
{
"parameters": {
"source": "database",
"workflowId": {
"__rl": true,
"value": "aicp-approval-gate",
"mode": "id"
},
"options": {
"waitForSubWorkflow": true
},
"workflowInputs": {
"mappingMode": "defineBelow",
"value": {
"action": "={{ $json.action }}",
"scope": "={{ $json.scope }}",
"riskTier": "={{ $json.riskTier }}",
"requester": "={{ $json.requester }}",
"dataTouched": "={{ $json.dataTouched }}",
"preview": "={{ $json.preview }}",
"dimensions": "={{ $json.dimensions }}",
"autoApprove": "={{ $json.autoApprove }}"
},
"matchingColumns": [],
"schema": [
{
"id": "action",
"displayName": "action",
"type": "string",
"required": true,
"defaultMatch": false,
"display": true,
"canBeUsedToMatch": true
},
{
"id": "scope",
"displayName": "scope",
"type": "string",
"required": true,
"defaultMatch": false,
"display": true,
"canBeUsedToMatch": true
},
{
"id": "riskTier",
"displayName": "riskTier",
"type": "string",
"required": true,
"defaultMatch": false,
"display": true,
"canBeUsedToMatch": true
},
{
"id": "requester",
"displayName": "requester",
"type": "string",
"required": true,
"defaultMatch": false,
"display": true,
"canBeUsedToMatch": true
},
{
"id": "dataTouched",
"displayName": "dataTouched",
"type": "string",
"required": true,
"defaultMatch": false,
"display": true,
"canBeUsedToMatch": true
},
{
"id": "preview",
"displayName": "preview",
"type": "string",
"required": true,
"defaultMatch": false,
"display": true,
"canBeUsedToMatch": true
},
{
"id": "dimensions",
"displayName": "dimensions",
"type": "string",
"required": true,
"defaultMatch": false,
"display": true,
"canBeUsedToMatch": true
},
{
"id": "autoApprove",
"displayName": "autoApprove",
"type": "boolean",
"required": true,
"defaultMatch": false,
"display": true,
"canBeUsedToMatch": true
}
],
"attemptToConvertTypes": false,
"convertFieldsToString": true
}
},
"id": "ffffffff-0000-0000-0000-00000000000a",
"name": "Request approval",
"type": "n8n-nodes-base.executeWorkflow",
"typeVersion": 1.2,
"position": [
1420,
300
]
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true
},
"conditions": [
{
"leftValue": "={{ $json.approved }}",
"rightValue": true,
"operator": {
"type": "boolean",
"operation": "equals"
}
}
]
},
"options": {}
},
"id": "ffffffff-0000-0000-0000-00000000000b",
"name": "Approved?",
"type": "n8n-nodes-base.if",
"typeVersion": 2.2,
"position": [
1620,
300
]
},
{
"parameters": {
"jsCode": "// Re-expand the approved batch back into per-file items for upload.\nreturn $('Build uploads').all().map(i => ({ json: i.json }));"
},
"id": "ffffffff-0000-0000-0000-00000000000c",
"name": "Expand approved",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
1820,
200
]
},
{
"parameters": {
"method": "POST",
"url": "https://www.googleapis.com/upload/drive/v3/files",
"authentication": "predefinedCredentialType",
"nodeCredentialType": "googleDriveOAuth2Api",
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "uploadType",
"value": "multipart"
},
{
"name": "supportsAllDrives",
"value": "true"
},
{
"name": "fields",
"value": "id,name,webViewLink"
}
]
},
"sendBody": true,
"contentType": "raw",
"rawContentType": "=multipart/related; boundary={{ $json.boundary }}",
"body": "={{ $json.uploadBody }}",
"options": {}
},
"id": "ffffffff-0000-0000-0000-000000000006",
"name": "Upload to Drive",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
2020,
200
]
},
{
"parameters": {
"method": "POST",
"url": "http://scrubber:8080/outbox/ack",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "x-scrubber-token",
"value": "change-me-to-a-long-random-secret"
}
]
},
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={{ { \"scope\": $('Expand approved').item.json.scope, \"filename\": $('Expand approved').item.json.filename } }}",
"options": {}
},
"id": "ffffffff-0000-0000-0000-000000000007",
"name": "Ack (archive to sent/)",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
2220,
200
]
},
{
"parameters": {
"jsCode": "const items = $input.all().map(i => i.json);\nconst cfg = $('Config').first().json;\nconst gate = $('Request approval').first().json;\nreturn [{ json: {\n severity: 'info',\n title: `Deliverables shipped: ${items.length} \u2192 scope ${cfg.scope}`,\n message: `Approval: ${gate.auto ? 'auto (gate off for this scope)' : 'human-approved'}\\n` + items.map(i => `- ${i.archived || '(ack failed?)'}`).join('\\n'),\n source: 'deliverables'\n} }];"
},
"id": "ffffffff-0000-0000-0000-000000000008",
"name": "Summary",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
2420,
200
]
},
{
"parameters": {
"jsCode": "// Rejected or timed out: ship nothing, say so. Deliverables stay pending in\n// deliverables/ (nothing is lost) and will reappear next cycle.\nconst gate = $('Request approval').first().json;\nconst cfg = $('Config').first().json;\nreturn [{ json: {\n severity: 'warn',\n title: `Deliverables NOT shipped [scope: ${cfg.scope}]`,\n message: gate.timedOut ? 'Approval timed out (24h) \u2014 default deny. Files remain pending.' : 'Rejected by approver. Files remain pending.',\n source: 'deliverables'\n} }];"
},
"id": "ffffffff-0000-0000-0000-00000000000d",
"name": "Rejected summary",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
1820,
420
]
},
{
"parameters": {
"source": "database",
"workflowId": {
"__rl": true,
"value": "aicp-notify",
"mode": "id"
},
"options": {
"waitForSubWorkflow": true
},
"workflowInputs": {
"mappingMode": "autoMapInputData",
"value": {},
"matchingColumns": [],
"schema": [
{
"id": "severity",
"displayName": "severity",
"type": "string",
"required": false,
"defaultMatch": false,
"display": true,
"canBeUsedToMatch": true
},
{
"id": "title",
"displayName": "title",
"type": "string",
"required": false,
"defaultMatch": false,
"display": true,
"canBeUsedToMatch": true
},
{
"id": "message",
"displayName": "message",
"type": "string",
"required": false,
"defaultMatch": false,
"display": true,
"canBeUsedToMatch": true
},
{
"id": "source",
"displayName": "source",
"type": "string",
"required": false,
"defaultMatch": false,
"display": true,
"canBeUsedToMatch": true
}
],
"attemptToConvertTypes": false,
"convertFieldsToString": true
}
},
"id": "n0t1fy00-0000-0000-0000-118805336285",
"name": "Notify",
"type": "n8n-nodes-base.executeWorkflow",
"typeVersion": 1.2,
"position": [
2640,
200
]
},
{
"id": "ondemand",
"name": "Run on demand",
"type": "n8n-nodes-base.executeWorkflowTrigger",
"typeVersion": 1.1,
"position": [
220,
460
],
"parameters": {
"inputSource": "passthrough"
}
}
],
"connections": {
"Every 15 min": {
"main": [
[
{
"node": "Config",
"type": "main",
"index": 0
}
]
]
},
"Config": {
"main": [
[
{
"node": "Fetch outbox (rehydrated)",
"type": "main",
"index": 0
}
]
]
},
"Fetch outbox (rehydrated)": {
"main": [
[
{
"node": "Build uploads",
"type": "main",
"index": 0
}
]
]
},
"Build uploads": {
"main": [
[
{
"node": "Has deliverables?",
"type": "main",
"index": 0
}
]
]
},
"Has deliverables?": {
"main": [
[
{
"node": "Approval request",
"type": "main",
"index": 0
}
],
[]
]
},
"Approval request": {
"main": [
[
{
"node": "Request approval",
"type": "main",
"index": 0
}
]
]
},
"Request approval": {
"main": [
[
{
"node": "Approved?",
"type": "main",
"index": 0
}
]
]
},
"Approved?": {
"main": [
[
{
"node": "Expand approved",
"type": "main",
"index": 0
}
],
[
{
"node": "Rejected summary",
"type": "main",
"index": 0
}
]
]
},
"Expand approved": {
"main": [
[
{
"node": "Upload to Drive",
"type": "main",
"index": 0
}
]
]
},
"Upload to Drive": {
"main": [
[
{
"node": "Ack (archive to sent/)",
"type": "main",
"index": 0
}
]
]
},
"Ack (archive to sent/)": {
"main": [
[
{
"node": "Summary",
"type": "main",
"index": 0
}
]
]
},
"Summary": {
"main": [
[
{
"node": "Notify",
"type": "main",
"index": 0
}
]
]
},
"Rejected summary": {
"main": [
[
{
"node": "Notify",
"type": "main",
"index": 0
}
]
]
},
"Run on demand": {
"main": [
[
{
"node": "Config",
"type": "main",
"index": 0
}
]
]
}
},
"settings": {
"errorWorkflow": "aicp-error-trigger"
},
"active": false
}
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
Deliverables → Drive (rehydrated). Uses httpRequest, executeWorkflowTrigger. Scheduled trigger; 15 nodes.
Source: https://github.com/jgobuilds/ai-control-plane-public/blob/main/n8n-workflows/deliverables.workflow.json — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
PF WF-02 Caption Generator v18.3. Uses microsoftSharePoint, httpRequest, executeWorkflowTrigger. Scheduled trigger; 39 nodes.
Drive → workspace sync (scrubbed). Uses httpRequest, executeWorkflowTrigger. Scheduled trigger; 10 nodes.
dispatch. Uses executeWorkflowTrigger, httpRequest. Scheduled trigger; 8 nodes.
Daily digest lane (scheduled, human-awareness digest tier). Uses httpRequest, executeWorkflowTrigger. Scheduled trigger; 6 nodes.
Dependency bumps (scheduled lane, AG-3). Uses httpRequest, executeWorkflowTrigger. Scheduled trigger; 6 nodes.