Create spreadsheet and populate with headers and deal information
Configured with Crypto, Gmail, Gmail Trigger, Google Sheets, and additional nodes. Review the connections and setup before adapting this template.
Node categories in this workflow
- AI & models
- Trigger
- Routing
- Transform
- Messaging
- Code
- Data store
- Web / API
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.
| Node | Category | Type | Operation |
|---|---|---|---|
| Generate reply | AI & models | Open Ai | See node parameters |
| On email received | Trigger | Gmail Trigger | See node parameters |
| Only continue for specific emails | Routing | If | See node parameters |
| Configure | Transform | Edit Fields | See node parameters |
| Send reply to recipient | Messaging | Gmail | reply |
| Generate UUID | Transform | Crypto | See node parameters |
| Thanks for your response! | Transform | Html | See node parameters |
| Extract message content (advanced) | Code | Code | See node parameters |
| If spreadsheet doesn't exist | Routing | If | See node parameters |
| Successfully created or updated row | Routing | No Op | See node parameters |
| Create spreadsheet | Data store | Google Sheets | spreadsheet |
| Store spreadsheet ID | Code | Code | See node parameters |
| Paste data | Data store | Google Sheets | append |
| If no sheet IDs | Routing | If | See node parameters |
| Create or update rows | Data store | Google Sheets | appendOrUpdate |
| Get data from `Format data` | Code | Code | See node parameters |
| Get data from `Format data` node | Code | Code | See node parameters |
| Format data | Transform | Edit Fields | See node parameters |
| Send email reply | Routing | No Op | See node parameters |
| On feedback given | Trigger | Webhook | See node parameters |
| Send feedback for fine-tuned data | Data store | Google Sheets | update |
| Show HTML page | Web / API | Respond To Webhook | See node parameters |
| Get sheet IDs #1 | Code | Code | See node parameters |
| If no spreadsheet in configuration #2 | Routing | If | See node parameters |
| Store specific sheet IDs #2 | Code | Code | See node parameters |
| Get sheet IDs #2 | Code | Code | See node parameters |
| If no spreadsheet in configuration #1 | Routing | If | See node parameters |
| Store specific sheet IDs #1 | Code | Code | See node parameters |
| Email template | Transform | Html | See node parameters |
| Record feedback | Routing | No Op | See node parameters |
| Fallback route | Routing | No Op | See node parameters |
| Identify trigger #2 | Transform | Edit Fields | See node parameters |
| Identify trigger #1 | Transform | Edit Fields | See node parameters |
| Do not send unfinished email reply | Routing | No Op | See node parameters |
| If reply is complete | Routing | If | See node parameters |
| Do not send email to this recipient | Routing | No Op | See node parameters |
| Send reply to database | Routing | No Op | See node parameters |
| Determine which trigger ran | Routing | Switch | See node parameters |
| Is text within token limit? | Routing | If | See node parameters |
| Do nothing | Routing | No Op | See node parameters |
Setup
- Download the JSON and import it into an isolated n8n instance. Leave the workflow inactive.
- Connect your own credentials through n8n’s credential store. Replace
REPLACE_WITH_*values with your resource identifiers. - Inspect API destinations, Code nodes, database queries, file paths, and outbound actions.
- 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
gmailOAuth2googleSheetsOAuth2ApiopenAiApi
Workflow notes
Configuration
Configuration
If you decide to use your own spreadsheet, it is up to you to ensure all columns are present before running this workflow. A good way to do this is to run this workflow once with empty spreadsheetid and worksheetId variables (see the Configure node). Then map the output from Store spreadsheet ID to this node.
It is recommended that you specify the spreadsheetId and worksheetId, since relying solely on a workflow's static data is considered bad practice.
spreadsheetId: The ID of the spreadsheet where Pipedrive deals will be stored.
worksheetId: The ID of the worksheet where Pipedrive deals will be stored.
spreadsheetName(required): The human readable name of the spreadsheet where Pipedrive deals will be stored.
worksheetName(required): The human readable name of the worksheet in the spreadsheet where Pipedrive deals will be stored.
recipients(required): Comma-separated list of email recipients to send ChatGPT emails to. Use * to send ChatGPT response to every email address.
maxTokenSize(required): The maximum token size for the model you choose. See possible models from OpenAI here.
replyTokenSize(required): The reply's maximum token size. Default is 300. This determines how much text the AI will reply with.
Create spreadsheet and populate with headers and deal information
Create spreadsheet and populate with headers and deal information
A spreadsheet is created if the spreadsheet does not exist. The spreadsheet ID is stored in the $getWorkflowStaticData('global') variable. Using Extract current deal node, the deal information is formatted for the sending to the new spreadsheet.
Tip: Deleting old spreadsheets
Tip: Deleting old spreadsheets
If you ever want to start over, delete the old spreadsheet, making sure that it is also deleted from Google Drive's trash.
`Get spreadsheet ID`
Get spreadsheet ID
The spreadsheet ID is stored in this workflow's static data. If you want to refresh the static data you will need to copy this entire workflow into a new workflow.
Sticky Note
If your workflow reaches this stage, you will need to consider increasing the tokens in Generate reply node.
Send a ChatGPT email reply when email received and save responses to Google Sheets
Send a ChatGPT email reply when email received and save responses to Google Sheets
This workflow sends a OpenAI GPT reply when an email is received from specific email recipients. It then saves the initial email and the GPT response to an automatically generated Google spreadsheet. Subsequent GPT responses will be added to the same spreadsheet. Additionally, when feedback is given for any of the GPT responses, it will be recorded to the spreasheet, which can then be used later to fine-tune the GPT model.
How it works
This workflow is essentially a two-in-one workflow. It triggers off from two different nodes and have very different functionality from each trigger.
On email received:
- Triggers off on the
On email receivednode. - Extract the email body from the email.
- Generate a response from the email body using the
OpenAInode. - Reply to the email sender using the
Send reply to recipientnode. A feedback link is also included in the email body which will trigger theOn feedback givennode. This is used to fine-tune the GPT model. - Save the email body and OpenAI response to a Google Sheet. If a sheet does not exist, it will be created.
On feedback given:
- Triggers off when a feedback link is clicked in the emailed GPT response.
- The feedback, either positive or negative, for that specific GPT response is then recorded to the Google Sheet.
Sticky Note2
This workflow should never reach this node. It is only here for extending the functionality of this workflow if needed.
Sticky Note3
The email that was received is too large to process, as it exceeds token limit. See more on token limits.
Create spreadsheet and populate with headers and deal information
Create spreadsheet and populate with headers and deal information
Purpose and structure
This folder contains the Create spreadsheet and populate with headers and deal information workflow. Its executable nodes use code, crypto, gmail, gmailTrigger, googleSheets, html, if, noOp, openAi, respondToWebhook, set, switch, webhook. 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
On email received, On feedback given
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/1653_Code_Webhook_Send_Webhook.json MIT; preserve source notices.