Google Docs Relevance AI Workflow (N8N)
Google Docs Relevance AI Workflow Documentation
Overview
The Google Docs Relevance AI workflow automates the creation of Google Docs using a webhook-triggered process, integrating AI-based relevance processing and external API calls. This workflow consists of multiple interconnected modules that fetch data, create a Google document, introduce a delay, and finally send the processed data to an external API.
Workflow Structure
The workflow consists of four key steps:
- Webhook Trigger (CustomWebHook) - Captures relevant data.
- Google Docs Creation (Google Docs API) - Generates a document in Google Drive.
- Delay Mechanism (Function Sleep) - Ensures synchronization of processes.
- Data Transmission (HTTP API Call) - Sends the processed document link to an AI agent.
Step 1: Webhook Trigger (CustomWebHook)
Module: gateway:CustomWebHook
-
ID:
4
-
Version:
1
-
Parameters:
-
hook
:1629209
-
maxResults
:1
-
-
Metadata:
-
Label:
Relevance AI
-
Advanced Settings:
- Accepts incoming webhook requests.
- Provides real-time data transfer.
-
Label:
This webhook is configured to receive data, limiting the maximum results to 1
for processing efficiency.
Step 2: Google Docs Creation
Module: google-docs:createADocument
-
ID:
3
-
Version:
1
-
Parameters:
-
__IMTCONN__
:2417312
(Google connection identifier)
-
-
Mapped Inputs:
-
name
:Call Script
-
content
:{{4.
CV HTML}}
(Data from webhook) -
destination
:drive
-
header
:false
-
footer
:false
-
folderId
:/14_9fsgtepoGQSiS-BhNAkJ_R-MNbbetD
-
This module creates a Google Document using data received from the webhook and saves it in a predefined Google Drive folder.
Step 3: Delay Mechanism (Synchronization)
Module: util:FunctionSleep
-
ID:
12
-
Version:
1
-
Parameters:
-
duration
:15
seconds
-
- Purpose: Introduces a delay to ensure that document creation is completed before proceeding to the next step.
Step 4: Sending Data to External API
Module: http:ActionSendData
-
ID:
9
-
Version:
3
-
Parameters:
-
Handle Errors:
true
-
Use New ZLib Decompress:
true
-
URL:
https://api-d7b62b.stack.tryrelevance.com/latest/agents/trigger
-
Method:
POST
-
Headers:
-
Content-Type
:application/json
-
Authorization
: Blank (to be configured)
-
-
Body Type:
raw
-
Content Type:
application/json
-
Request Payload:
{ "message": { "role": "user", "content": "Here is the Call Script: {{3.webViewLink}}" }, "agent_id": "USE YOUR AGENT ID", "conversation_id": "USE YOUR CONVERSATION ID" }
-
Security Settings:
-
rejectUnauthorized
:true
-
followRedirect
:true
-
gzip
:true
-
useMtls
:false
-
-
Handle Errors:
This module sends the generated document's link to an external AI agent for further processing.
Metadata & Execution Settings
General Workflow Metadata
-
Workflow Type:
Instant Trigger
-
Version:
1
-
Scenario Settings:
-
roundtrips
:1
-
maxErrors
:3
-
autoCommit
:true
-
sequential
:false
-
This ensures the workflow runs immediately upon receiving a webhook request, with error handling and commit settings enabled.
Conclusion
The Google Docs Relevance AI workflow is designed to automate document generation, ensure proper synchronization, and forward processed data to an AI system for further use. Configuration parameters such as authentication tokens and API endpoints need to be properly set up for seamless integration.