Back to Catalog

Cost-free email follow-up sequence with Google Sheets and Gmail

Gerald DenorGerald Denor
75 views
2/3/2026
Official Page

Simple But Powerful Email Automation for Everyone: No AI, No API Costs!

This n8n workflow template, "Email Outreach Automation," is designed to help you set up an automated email outreach system using tools you might already be familiar with: Google Sheets and Google Docs.

At its core, this workflow is a sequence of steps that n8n follows to send personalized emails to a list of contacts. The best part? It's built to be incredibly cost-effective, meaning you won't need to pay for any external API services or AI subscriptions to make it work. This makes it an ideal starting point for anyone new to automation or looking to manage their budget.

How Does This Workflow Work?

Think of this n8n workflow as a digital assistant that handles your email outreach from start to finish. Here's a simplified breakdown of what happens behind the scenes:

  1. Your Contact List (Google Sheet): The workflow starts by reading your contact information (like names, emails, and company details) from a Google Sheet. This is where you'll keep all the people you want to email.

  2. Email Content (Google Docs): Instead of writing each email individually, you'll create email templates in Google Docs. The workflow can then pull the content from these documents and personalize it for each recipient. This means you can use placeholders like {{firstname}} or {{company}} in your Google Doc, and the workflow will automatically replace them with the correct information for each person.

  3. Smart Email Sequencing: The workflow is designed to send a series of emails to each contact. It keeps track of which email was sent last to each person in your Google Sheet. This ensures that your contacts receive the emails in the correct order and don't get the same email twice.

  4. Sending Emails (Gmail or SMTP): Once the workflow has the contact's details and the personalized email content, it uses your Gmail account (or any other SMTP service you configure) to send the email. It even includes a

built-in delay to avoid hitting email sending limits.

  1. Updating Your Records: After sending an email, the workflow updates your Google Sheet to record which email was sent and when. This helps you keep track of your outreach efforts and ensures that contacts who have completed the email sequence are not emailed again.

Key Features for Beginners:

  • No Coding Required: While n8n involves visual programming, you don't need to write complex code to use this workflow. It's pre-built and ready for you to configure with your Google Sheet and Google Doc IDs.
  • Free to Use (No Hidden Costs): This is a major advantage! Unlike many other email automation tools that charge per email or require expensive API keys, this workflow leverages free services. You can run your campaigns without worrying about unexpected bills.
  • Easy Configuration: The workflow includes a "Settings" node where you can easily input your Google Sheet and Google Doc IDs, as well as your email subjects. This centralizes all your important settings in one place.
  • Built-in Safeguards: Features like the "Filter passes only unprocessed contacts" and "Has contact completed email sequence?" nodes ensure that you only email the right people at the right time, preventing accidental re-sends.
  • Scalable: As you get more comfortable, you can easily expand this workflow to handle more contacts or more complex email sequences. It's a great foundation for learning more about automation.

What You'll Need to Get Started:

  • An n8n instance (you can run it locally, use a cloud provider, or n8n.cloud)
  • A Google account (for Google Sheets and Google Docs)
  • A Gmail account (or SMTP credentials for sending emails)

This workflow is your entry point into efficient and affordable email automation. It's designed to be straightforward for beginners while offering powerful capabilities. Get ready to automate your outreach and see the results!

Setup Guide:

Sample Google Doc Sample Google Sheet

Need Help?

Reach me: https://www.linkedin.com/in/gerald-akhidenor-1ab1a45/

Work with me: https://dominixai.com/

My website: https://jobmonkey.dev

My email: denorgerald@gmail.com

This guide will walk you through the process of setting up and running the Email Outreach Automation. This powerful workflow allows you to automate personalized email campaigns using n8n, Google Sheets, and Google Docs, all without incurring any API or AI subscription costs. Follow these steps to get your automated outreach up and running.

Prerequisites

Before you begin, ensure you have the following:

  • An n8n Instance: This can be a local installation, a self-hosted server, or an n8n.cloud account. If you don't have one, you can find installation instructions on the official n8n website [1].

  • A Google Account: You will need this to create and manage your Google Sheets (for contacts) and Google Docs (for email templates).

  • A Gmail Account (or SMTP Credentials): This workflow uses Gmail by default for sending emails. If you prefer to use another email service, you will need its SMTP credentials.

Step 1: Import the Workflow into n8n

  1. Download the Workflow: Ensure you have the EmailOutreachAutomation.json file downloaded to your computer.

  2. Open n8n: Log in to your n8n instance.

  3. Import: In the n8n dashboard, click on the "Workflows" tab in the left sidebar. Then, click the "New" button (or the + icon) and select "Import from JSON".

  4. Upload the File: A dialog box will appear. Click "Browse" or drag and drop the EmailOutreachAutomation.json file into the designated area. Click "Import".

  5. Save the Workflow: Once imported, the workflow will open in the editor. Click the "Save" button (usually located in the top right corner) to save your new workflow.

Step 2: Prepare Your Google Sheet for Contacts

This workflow uses a Google Sheet as your contact database. You need to create a new Google Sheet and populate it with your contact information. The workflow expects specific column headers to function correctly.

  1. Create a New Google Sheet: Go to Google Sheets (sheets.google.com) and create a new blank spreadsheet.

  2. Name Your Sheet: Give your spreadsheet a descriptive name (e.g., "JobMonkey Email List").

  3. Add Required Columns: In the first row of your sheet, add the following column headers exactly as they appear below (case-sensitive):

  • firstname
  • lastname
  • email
  • company
  • last_email_sent (This column will be updated by the workflow to track the last email sent to each contact. Leave it blank initially.)
  • last_email_date (This column will be updated by the workflow with the date the last email was sent. Leave it blank initially.)
  • processed (This column will be updated by the workflow to mark contacts as processed. Leave it blank initially.)
  1. Populate with Data: Fill in your contact data under the respective columns. Ensure the email column contains valid email addresses.

  2. Get Your Google Sheet ID: The Google Sheet ID is part of the URL when you open your spreadsheet. It's the long string of characters between /d/ and /edit. Copy this ID; you will need it in Step 4.

Step 3: Prepare Your Google Docs Email Templates

This workflow sends a sequence of up to 9 emails. You will create a separate Google Doc for each email in your sequence. The workflow uses placeholders in these documents to personalize the emails.

  1. Create New Google Docs: Go to Google Docs (docs.google.com) and create a new blank document for each email you plan to send (e.g., "Email 1 Template", "Email 2 Template", etc.). The workflow is configured for up to 9 emails, but you can use fewer.

  2. Write Your Email Content: Write the content for each email in its respective Google Doc. You can use the following variables (placeholders) which the workflow will automatically replace with data from your Google Sheet:

  • {{firstname}}
  • {{lastname}}
  • {{company}}
  • {{email}}
  1. Get Your Google Doc IDs: For each Google Doc, copy its ID from the URL. It's the long string of characters between /d/ and /edit. You will need these IDs in Step 4.

Step 4: Configure the 'Settings' Node in n8n

This is the most crucial step for customizing the workflow. The 'Settings' node holds all the essential IDs and subjects for your campaign.

  1. Open the Workflow: In n8n, open the Email Outreach JobMonkey copy workflow you imported.

  2. Locate the 'Settings' Node: Find the node named "Settings" (it's usually near the top, connected to the 'Schedule Trigger'). Double-click it to open its configuration.

  3. Update 'googlesheetid':

  • Find the assignment named googlesheetid.
  • Replace the existing value with the Google Sheet ID you copied in Step 2.
  1. Update 'googledocid_X' and 'emailsubject_X':
  • For each email in your sequence (e.g., googledocid_1, googledocid_2, etc.), replace the value with the corresponding Google Doc ID you copied in Step 3.
  • Similarly, for each emailsubject_X, update the value with the subject line you want for that specific email.
  1. Close the 'Settings' Node: Click "Done" or close the node configuration.

Step 5: Configure Email Sending Credentials (Gmail or SMTP)

The workflow uses a 'Send a message' node (Gmail node) to send emails. You need to provide your Gmail credentials or configure an SMTP service.

Option A: Using Gmail (Recommended for Simplicity)

  1. Locate the 'Send a message' Node: Find the node named "Send a message" (it's a Gmail node) in the workflow. Double-click it.

  2. Add Gmail Account: Under the 'Credentials' section, click "Add new" next to gmailOAuth2.

  3. Connect to Google: A new window will open, prompting you to connect your Google account. Follow the on-screen instructions to grant n8n access to send emails on your behalf. Select the Gmail account you wish to use for sending.

  4. Save Credentials: Once connected, save the credentials.

  5. Close the Node: Click "Done" or close the node configuration.

Option B: Using an SMTP Service (Advanced)

If you prefer to use a different email service via SMTP:

  1. Replace the 'Send a message' Node: Delete the existing "Send a message" (Gmail) node.

  2. Add a New SMTP Node: Search for and add an "SMTP" node to your workflow. Connect it in place of the deleted Gmail node.

  3. Configure SMTP Credentials: Double-click the new SMTP node. You will need to provide your SMTP host, port, username, and password. Consult your email provider's documentation for these details.

  4. Map Fields: Ensure the To, Subject, and Message fields in the SMTP node are correctly mapped to the data coming from the previous nodes (e.g., ={{ $(\'Loop Over Items\').item.json.email }} for the recipient email, ={{ $(\'Settings\').item.json[\'emailsubject_\' + $(\'Determine Email Number\').item.json.emailNumber] }} for the subject, and ={{ $json.html }} for the message body).

  5. Close the Node: Click "Done" or close the node configuration.

Step 6: Configure the Schedule Trigger (Optional but Recommended)

The 'Schedule Trigger' node determines when your workflow will run automatically. By default, it's set to run at 6 AM, 12 PM, and 6 PM.

  1. Locate the 'Schedule Trigger' Node: Find the node named "Schedule Trigger" (it's the very first node in the workflow). Double-click it.

  2. Adjust Schedule: You can modify the schedule to fit your needs. For example, to run daily at 9 AM, you would set the hour to 9.

  3. Close the Node: Click "Done" or close the node configuration.

Step 7: Activate and Test Your Workflow

Once all configurations are complete, it's time to activate and test your workflow.

  1. Activate the Workflow: In the top right corner of the n8n editor, toggle the "Active" switch to ON.

  2. Test Manually (Optional but Recommended): To perform a test run without waiting for the schedule, click the "Execute Workflow" button (usually a play icon) in the top right corner. This will run the workflow once.

  3. Monitor Execution: After execution, check the 'Executions' tab in n8n to see the status of your workflow runs. You can also check your Google Sheet to see if the last_email_sent and processed columns have been updated, and check your email outbox to confirm emails were sent.

Important Considerations

  • Email Sending Limits: Be aware of the sending limits of your email provider (e.g., Gmail has a daily sending limit). The workflow includes a 'Wait' node to help space out emails, but adjust it (amount parameter in the 'Wait' node) if you encounter issues.

  • Google API Quotas: While this workflow avoids paid API subscriptions, Google services do have free usage quotas. For very high volumes, you might eventually hit these, but for typical outreach, this should not be an issue.

  • Error Handling: The workflow has basic error handling. If you encounter issues, check the 'Executions' tab in n8n for error messages, which can help you diagnose problems.

  • Customization: Feel free to explore and customize other nodes in the workflow as you become more familiar with n8n. For example, you can adjust the 'Limits the number of emails per run' node to control how many emails are sent in each execution.

By following these steps, you will have a fully functional, automated email outreach system that is both powerful and cost-effective. Happy automating!

Cost-Free Email Follow-Up Sequence with Google Sheets and Gmail

This n8n workflow automates a cost-free email follow-up sequence. It leverages Google Sheets to manage contacts and email content, and Gmail to send personalized follow-up emails. The workflow includes logic to track follow-up stages and prevent sending emails to contacts who have already been contacted.

What it does

This workflow performs the following steps:

  1. Triggers on a Schedule: The workflow starts on a predefined schedule (e.g., daily, weekly).
  2. Reads Google Sheet Data: It connects to a specified Google Sheet to retrieve a list of contacts and their follow-up status.
  3. Filters for New Contacts: It filters the retrieved data to identify contacts who have not yet received a follow-up email.
  4. Limits Processing: It applies a limit to the number of contacts processed in a single run, preventing overwhelming email sending.
  5. Prepares Email Content: It uses a Google Docs template to generate the email body for the follow-up.
  6. Sets Email Fields: It dynamically sets the recipient's email address, subject, and body for each email.
  7. Sends Email via Gmail: For each eligible contact, it sends a personalized follow-up email using Gmail.
  8. Updates Google Sheet: After sending an email, it updates the Google Sheet to mark the contact as "followed up" to prevent duplicate emails.

Prerequisites/Requirements

To use this workflow, you will need:

  • n8n Instance: A running instance of n8n.
  • Google Account: A Google account with access to:
    • Google Sheets: To store your contact list and follow-up status.
    • Gmail: To send the follow-up emails.
    • Google Docs: To store your email template.
  • Google Credentials in n8n: Configured Google OAuth2 credentials in n8n for Google Sheets, Gmail, and Google Docs.

Setup/Usage

  1. Import the Workflow: Import the provided JSON into your n8n instance.
  2. Configure Credentials:
    • Set up your Google OAuth2 credentials in n8n if you haven't already.
    • Ensure the Google Sheets, Gmail, and Google Docs nodes are configured to use these credentials.
  3. Prepare Google Sheet:
    • Create a Google Sheet with columns for your contacts (e.g., Email, Name, FollowUpStatus).
    • Ensure there's a column to track the follow-up status (e.g., initially empty or "Not Sent").
  4. Prepare Google Docs Template:
    • Create a Google Docs document to serve as your email template. You can use placeholders (e.g., {{ $json.name }}) that will be replaced by data from your Google Sheet.
  5. Configure Nodes:
    • Schedule Trigger: Adjust the schedule to your desired frequency (e.g., every day, once a week).
    • Google Sheets (Read):
      • Specify the Spreadsheet ID and Sheet Name of your contact list.
      • Ensure the "Read All" operation is selected.
    • Filter:
      • Configure the condition to filter for contacts where FollowUpStatus is not "Sent" (or your chosen indicator).
    • Limit: Adjust the "Limit" value if you want to control how many emails are sent per workflow run.
    • Google Docs:
      • Specify the Document ID of your email template.
      • Ensure the "Get Content" operation is selected, and choose HTML for the output format.
    • Edit Fields (Set):
      • Map the data from your Google Sheet and Google Docs to the fields required for the email (e.g., To, Subject, Body).
      • The Body should reference the HTML content from the Google Docs node.
    • Gmail:
      • Set the "Operation" to "Send Email".
      • Map the To, Subject, and Body fields from the previous "Edit Fields" node.
    • Google Sheets (Update):
      • Specify the Spreadsheet ID and Sheet Name.
      • Set the "Operation" to "Update Row".
      • Map the Row Index to the row of the contact that was just processed.
      • Set the FollowUpStatus column to "Sent" (or your chosen indicator).
  6. Activate the Workflow: Once configured, activate the workflow to start the automated follow-up sequence.

Related Templates

Track competitor SEO keywords with Decodo + GPT-4.1-mini + Google Sheets

This workflow automates competitor keyword research using OpenAI LLM and Decodo for intelligent web scraping. Who this is for SEO specialists, content strategists, and growth marketers who want to automate keyword research and competitive intelligence. Marketing analysts managing multiple clients or websites who need consistent SEO tracking without manual data pulls. Agencies or automation engineers using Google Sheets as an SEO data dashboard for keyword monitoring and reporting. What problem this workflow solves Tracking competitor keywords manually is slow and inconsistent. Most SEO tools provide limited API access or lack contextual keyword analysis. This workflow solves that by: Automatically scraping any competitor’s webpage with Decodo. Using OpenAI GPT-4.1-mini to interpret keyword intent, density, and semantic focus. Storing structured keyword insights directly in Google Sheets for ongoing tracking and trend analysis. What this workflow does Trigger — Manually start the workflow or schedule it to run periodically. Input Setup — Define the website URL and target country (e.g., https://dev.to, france). Data Scraping (Decodo) — Fetch competitor web content and metadata. Keyword Analysis (OpenAI GPT-4.1-mini) Extract primary and secondary keywords. Identify focus topics and semantic entities. Generate a keyword density summary and SEO strength score. Recommend optimization and internal linking opportunities. Data Structuring — Clean and convert GPT output into JSON format. Data Storage (Google Sheets) — Append structured keyword data to a Google Sheet for long-term tracking. Setup Prerequisites If you are new to Decode, please signup on this link visit.decodo.com n8n account with workflow editor access Decodo API credentials OpenAI API key Google Sheets account connected via OAuth2 Make sure to install the Decodo Community node. Create a Google Sheet Add columns for: primarykeywords, seostrengthscore, keyworddensity_summary, etc. Share with your n8n Google account. Connect Credentials Add credentials for: Decodo API credentials - You need to register, login and obtain the Basic Authentication Token via Decodo Dashboard OpenAI API (for GPT-4o-mini) Google Sheets OAuth2 Configure Input Fields Edit the “Set Input Fields” node to set your target site and region. Run the Workflow Click Execute Workflow in n8n. View structured results in your connected Google Sheet. How to customize this workflow Track Multiple Competitors → Use a Google Sheet or CSV list of URLs; loop through them using the Split In Batches node. Add Language Detection → Add a Gemini or GPT node before keyword analysis to detect content language and adjust prompts. Enhance the SEO Report → Expand the GPT prompt to include backlink insights, metadata optimization, or readability checks. Integrate Visualization → Connect your Google Sheet to Looker Studio for SEO performance dashboards. Schedule Auto-Runs → Use the Cron Node to run weekly or monthly for competitor keyword refreshes. Summary This workflow automates competitor keyword research using: Decodo for intelligent web scraping OpenAI GPT-4.1-mini for keyword and SEO analysis Google Sheets for live tracking and reporting It’s a complete AI-powered SEO intelligence pipeline ideal for teams that want actionable insights on keyword gaps, optimization opportunities, and content focus trends, without relying on expensive SEO SaaS tools.

Ranjan DailataBy Ranjan Dailata
161

Generate song lyrics and music from text prompts using OpenAI and Fal.ai Minimax

Spark your creativity instantly in any chat—turn a simple prompt like "heartbreak ballad" into original, full-length lyrics and a professional AI-generated music track, all without leaving your conversation. 📋 What This Template Does This chat-triggered workflow harnesses AI to generate detailed, genre-matched song lyrics (at least 600 characters) from user messages, then queues them for music synthesis via Fal.ai's minimax-music model. It polls asynchronously until the track is ready, delivering lyrics and audio URL back in chat. Crafts original, structured lyrics with verses, choruses, and bridges using OpenAI Submits to Fal.ai for melody, instrumentation, and vocals aligned to the style Handles long-running generations with smart looping and status checks Returns complete song package (lyrics + audio link) for seamless sharing 🔧 Prerequisites n8n account (self-hosted or cloud with chat integration enabled) OpenAI account with API access for GPT models Fal.ai account for AI music generation 🔑 Required Credentials OpenAI API Setup Go to platform.openai.com → API keys (sidebar) Click "Create new secret key" → Name it (e.g., "n8n Songwriter") Copy the key and add to n8n as "OpenAI API" credential type Test by sending a simple chat completion request Fal.ai HTTP Header Auth Setup Sign up at fal.ai → Dashboard → API Keys Generate a new API key → Copy it In n8n, create "HTTP Header Auth" credential: Name="Fal.ai", Header Name="Authorization", Header Value="Key [Your API Key]" Test with a simple GET to their queue endpoint (e.g., /status) ⚙️ Configuration Steps Import the workflow JSON into your n8n instance Assign OpenAI API credentials to the "OpenAI Chat Model" node Assign Fal.ai HTTP Header Auth to the "Generate Music Track", "Check Generation Status", and "Fetch Final Result" nodes Activate the workflow—chat trigger will appear in your n8n chat interface Test by messaging: "Create an upbeat pop song about road trips" 🎯 Use Cases Content Creators: YouTubers generating custom jingles for videos on the fly, streamlining production from idea to audio export Educators: Music teachers using chat prompts to create era-specific folk tunes for classroom discussions, fostering interactive learning Gift Personalization: Friends crafting anniversary R&B tracks from shared memories via quick chats, delivering emotional audio surprises Artist Brainstorming: Songwriters prototyping hip-hop beats in real-time during sessions, accelerating collaboration and iteration ⚠️ Troubleshooting Invalid JSON from AI Agent: Ensure the system prompt stresses valid JSON; test the agent standalone with a sample query Music Generation Fails (401/403): Verify Fal.ai API key has minimax-music access; check usage quotas in dashboard Status Polling Loops Indefinitely: Bump wait time to 45-60s for complex tracks; inspect fal.ai queue logs for bottlenecks Lyrics Under 600 Characters: Tweak agent prompt to enforce fuller structures like [V1][C][V2][B][C]; verify output length in executions

Daniel NkenchoBy Daniel Nkencho
601

Automate invoice processing with OCR, GPT-4 & Salesforce opportunity creation

PDF Invoice Extractor (AI) End-to-end pipeline: Watch Drive ➜ Download PDF ➜ OCR text ➜ AI normalize to JSON ➜ Upsert Buyer (Account) ➜ Create Opportunity ➜ Map Products ➜ Create OLI via Composite API ➜ Archive to OneDrive. --- Node by node (what it does & key setup) 1) Google Drive Trigger Purpose: Fire when a new file appears in a specific Google Drive folder. Key settings: Event: fileCreated Folder ID: google drive folder id Polling: everyMinute Creds: googleDriveOAuth2Api Output: Metadata { id, name, ... } for the new file. --- 2) Download File From Google Purpose: Get the file binary for processing and archiving. Key settings: Operation: download File ID: ={{ $json.id }} Creds: googleDriveOAuth2Api Output: Binary (default key: data) and original metadata. --- 3) Extract from File Purpose: Extract text from PDF (OCR as needed) for AI parsing. Key settings: Operation: pdf OCR: enable for scanned PDFs (in options) Output: JSON with OCR text at {{ $json.text }}. --- 4) Message a model (AI JSON Extractor) Purpose: Convert OCR text into strict normalized JSON array (invoice schema). Key settings: Node: @n8n/n8n-nodes-langchain.openAi Model: gpt-4.1 (or gpt-4.1-mini) Message role: system (the strict prompt; references {{ $json.text }}) jsonOutput: true Creds: openAiApi Output (per item): $.message.content → the parsed JSON (ensure it’s an array). --- 5) Create or update an account (Salesforce) Purpose: Upsert Buyer as Account using an external ID. Key settings: Resource: account Operation: upsert External Id Field: taxid_c External Id Value: ={{ $json.message.content.buyer.tax_id }} Name: ={{ $json.message.content.buyer.name }} Creds: salesforceOAuth2Api Output: Account record (captures Id) for downstream Opportunity. --- 6) Create an opportunity (Salesforce) Purpose: Create Opportunity linked to the Buyer (Account). Key settings: Resource: opportunity Name: ={{ $('Message a model').item.json.message.content.invoice.code }} Close Date: ={{ $('Message a model').item.json.message.content.invoice.issue_date }} Stage: Closed Won Amount: ={{ $('Message a model').item.json.message.content.summary.grand_total }} AccountId: ={{ $json.id }} (from Upsert Account output) Creds: salesforceOAuth2Api Output: Opportunity Id for OLI creation. --- 7) Build SOQL (Code / JS) Purpose: Collect unique product codes from AI JSON and build a SOQL query for PricebookEntry by Pricebook2Id. Key settings: pricebook2Id (hardcoded in script): e.g., 01sxxxxxxxxxxxxxxx Source lines: $('Message a model').first().json.message.content.products Output: { soql, codes } --- 8) Query PricebookEntries (Salesforce) Purpose: Fetch PricebookEntry.Id for each Product2.ProductCode. Key settings: Resource: search Query: ={{ $json.soql }} Creds: salesforceOAuth2Api Output: Items with Id, Product2.ProductCode (used for mapping). --- 9) Code in JavaScript (Build OLI payloads) Purpose: Join lines with PBE results and Opportunity Id ➜ build OpportunityLineItem payloads. Inputs: OpportunityId: ={{ $('Create an opportunity').first().json.id }} Lines: ={{ $('Message a model').first().json.message.content.products }} PBE rows: from previous node items Output: { body: { allOrNone:false, records:[{ OpportunityLineItem... }] } } Notes: Converts discount_total ➜ per-unit if needed (currently commented for standard pricing). Throws on missing PBE mapping or empty lines. --- 10) Create Opportunity Line Items (HTTP Request) Purpose: Bulk create OLIs via Salesforce Composite API. Key settings: Method: POST URL: https://<your-instance>.my.salesforce.com/services/data/v65.0/composite/sobjects Auth: salesforceOAuth2Api (predefined credential) Body (JSON): ={{ $json.body }} Output: Composite API results (per-record statuses). --- 11) Update File to One Drive Purpose: Archive the original PDF in OneDrive. Key settings: Operation: upload File Name: ={{ $json.name }} Parent Folder ID: onedrive folder id Binary Data: true (from the Download node) Creds: microsoftOneDriveOAuth2Api Output: Uploaded file metadata. --- Data flow (wiring) Google Drive Trigger → Download File From Google Download File From Google → Extract from File → Update File to One Drive Extract from File → Message a model Message a model → Create or update an account Create or update an account → Create an opportunity Create an opportunity → Build SOQL Build SOQL → Query PricebookEntries Query PricebookEntries → Code in JavaScript Code in JavaScript → Create Opportunity Line Items --- Quick setup checklist 🔐 Credentials: Connect Google Drive, OneDrive, Salesforce, OpenAI. 📂 IDs: Drive Folder ID (watch) OneDrive Parent Folder ID (archive) Salesforce Pricebook2Id (in the JS SOQL builder) 🧠 AI Prompt: Use the strict system prompt; jsonOutput = true. 🧾 Field mappings: Buyer tax id/name → Account upsert fields Invoice code/date/amount → Opportunity fields Product name must equal your Product2.ProductCode in SF. ✅ Test: Drop a sample PDF → verify: AI returns array JSON only Account/Opportunity created OLI records created PDF archived to OneDrive --- Notes & best practices If PDFs are scans, enable OCR in Extract from File. If AI returns non-JSON, keep “Return only a JSON array” as the last line of the prompt and keep jsonOutput enabled. Consider adding validation on parsing.warnings to gate Salesforce writes. For discounts/taxes in OLI: Standard OLI fields don’t support per-line discount amounts directly; model them in UnitPrice or custom fields. Replace the Composite API URL with your org’s domain or use the Salesforce node’s Bulk Upsert for simplicity.

Le NguyenBy Le Nguyen
942