← All N8N workflows
Data & databasesCodeExecute WorkflowExecute Workflow TriggerFilterGmail

Send follow-up emails if appropriate

Configured with Execute Workflow, Execute Workflow Trigger, Filter, Gmail, and additional nodes. Review the connections and setup before adapting this template.

Workflow preview
Data storeUpdate last contactedtimeGoogle SheetsTransformSet message templateEdit FieldsTransformEmail sequenceEdit FieldsCodeFill messageplaceholdersCodeTransformCompose messageEdit FieldsMessagingGet previous messagethreadsGmailMessagingGet thread detailsGmailCodeClassify threadsCodeRoutingNext message due?FilterTriggerExecute WorkflowTriggerExecute Workflow TriggerRoutingReplying?IfMessagingSend new messageGmailSubworkflowCall message sendsub-workflowExecute WorkflowTransformPrepare reply paramsEdit FieldsTransformPrepare first messageparamsEdit FieldsSubworkflowCall message sendsub-workflow1Execute WorkflowRoutingTo email?FilterCodeDecode messagesCodeCodeDecode placeholdervaluesCodeCodePackage placeholdervaluesCodeTransformSettingsEdit FieldsMessagingReply to messageGmailData storeGet emailsGoogle SheetsTriggerEvery hourSchedule TriggerRoutingDon't email on weekendsFilter

Node categories in this workflow

  • Data store
  • Transform
  • Code
  • Messaging
  • Routing
  • Trigger
  • Subworkflow

Icons describe general node roles, inferred from node types. Inspect the parameters for the configured action.

Drag to pan; use + and − to zoom. Reconstructed from the exported node positions; nothing runs here. Dashed lines represent non-main connections. Full node names and notes appear below.

How it works

The exported workflow contains the following configured nodes. Their connections are shown above; inspect the JSON for the complete logic, expressions, and external actions.

Workflow node names, types, and operations
NodeCategoryTypeOperation
Update last contacted timeData storeGoogle Sheetsupdate
Set message templateTransformEdit FieldsSee node parameters
Email sequenceTransformEdit FieldsSee node parameters
Fill message placeholdersCodeCodeSee node parameters
Compose messageTransformEdit FieldsSee node parameters
Get previous message threadsMessagingGmailthread
Get thread detailsMessagingGmailthread / get
Classify threadsCodeCodeSee node parameters
Next message due?RoutingFilterSee node parameters
Execute Workflow TriggerTriggerExecute Workflow TriggerSee node parameters
Replying?RoutingIfSee node parameters
Send new messageMessagingGmailSee node parameters
Call message send sub-workflowSubworkflowExecute WorkflowSee node parameters
Prepare reply paramsTransformEdit FieldsSee node parameters
Prepare first message paramsTransformEdit FieldsSee node parameters
Call message send sub-workflow1SubworkflowExecute WorkflowSee node parameters
To email?RoutingFilterSee node parameters
Decode messagesCodeCodeSee node parameters
Decode placeholder valuesCodeCodeSee node parameters
Package placeholder valuesCodeCodeSee node parameters
SettingsTransformEdit FieldsSee node parameters
Reply to messageMessagingGmailreply
Get emailsData storeGoogle SheetsSee node parameters
Every hourTriggerSchedule TriggerSee node parameters
Don't email on weekendsRoutingFilterSee node parameters

Setup

  1. Download the JSON and import it into an isolated n8n instance. Leave the workflow inactive.
  2. Connect your own credentials through n8n’s credential store. Replace REPLACE_WITH_* values with your resource identifiers.
  3. Inspect API destinations, Code nodes, database queries, file paths, and outbound actions.
  4. Run with synthetic data and harmless destinations. Enable triggers only after checking the actual outputs.

Requirements

An n8n instance with the listed node types and compatible versions. Service-connected workflows may require accounts, credentials, or paid APIs.

Credential types declared in the source

  • gmailOAuth2
  • googleSheetsOAuth2Api

Workflow notes

Sticky Note2

Follow-up is due if:

  • All the messages in the thread are automated (no-one has replied yet)
  • Enough time has passed for the next message to be sent
Sticky Note4

Columns the sheet needs

  • email
  • first_emailed (leave blank - will be filled in automatically)
  • Other columns matching placeholders in email sequence
Sub-workflow for sending the emails

Sub-workflow for sending the emails

This is called by the sections above - you shouldn't need to touch it

Sticky Note3

If reply_message_id is set, will reply to that message.

Otherwise, will send a new message to the user in the 'email' field

Try me out

Try me out

  1. Clone this Google worksheet and update the 'Settings' node with its URL (plus change any other settings there you need to)
  2. Adjust the sequence of emails you want to send in the 'Email Sequence' node

Make sure you set how many days after the previous email to wait before sending, and note that the emails are in HTML format.

Send follow-up emails if appropriate

Send follow-up emails if appropriate

Purpose and structure

This folder contains the Send follow-up emails if appropriate workflow. Its executable nodes use code, executeWorkflow, executeWorkflowTrigger, filter, gmail, googleSheets, if, scheduleTrigger, set. The table and connection map below are derived from the JSON, not an inferred guarantee of behavior.

Setup

Import inactive. Configure your own credentials and replace REPLACE_WITH_* values. Review external destinations and Code nodes before running.

Entry points

Execute Workflow Trigger, Every hour

Verification

Sanitized source candidate; not runtime-tested. This overview is generated from node metadata. Read the folder README for the connection map, credential types, and license.

Attribution

https://github.com/Zie619/n8n-workflows/blob/94007c1445d9258a7da116646b79473e7c7c3282/workflows/Code/0437_Code_Filter_Create_Scheduled.json MIT; preserve source notices.

Canvas section labels

These name areas of the original canvas; they do not include explanatory instructions.

  • Send initial emails
  • Send follow-up emails if appropriate

More in Data & databases