HUBSPOT LIFECYCLESTAGE (LEAD STATUS)
Configured with Google Sheets, HTTP Request, Hubspot, Postgres, and additional nodes. Review the connections and setup before adapting this template.
Node categories in this workflow
- Web / API
- Routing
- Data store
- Transform
- Code
- Integration
- Trigger
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 |
|---|---|---|---|
| EXTRACT CAMPAIGN DATA | Web / API | HTTP Request | See node parameters |
| FETCH ALL CAMPAIGNS | Web / API | HTTP Request | See node parameters |
| Loop Over Items | Routing | Loop Over Items | See node parameters |
| UPDATE CAMPAIGN | Data store | Postgres | upsert |
| Merge | Transform | Merge | See node parameters |
| Code | Code | Code | See node parameters |
| Loop Over Items1 | Routing | Loop Over Items | See node parameters |
| HubSpot | Integration | Hubspot | getAll |
| If | Routing | If | See node parameters |
| Schedule Trigger | Trigger | Schedule Trigger | See node parameters |
| UPSERT CAMPAIGN ACTIVITY | Data store | Postgres | upsert |
| HUBSPOT TABLE | Data store | Postgres | upsert |
| SEARCH | Data store | Postgres | executeQuery |
| Postgres1 | Data store | Postgres | update |
| UPDATE HUBSPOT ACTIVITY TABLE | Data store | Postgres | update |
| SET SMARTLEAD API KEY | Transform | Edit Fields | See node parameters |
| Postgres | Data store | Postgres | executeQuery |
| Google Sheets | Data store | Google Sheets | appendOrUpdate |
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
googleSheetsOAuth2ApihubspotOAuth2Apipostgres
Workflow notes
Code
// Retrieve the CSV-like data from the 'data' field in the input const csvData = $json['data']; // Ensure that 'data' is the correct field name
// Check if csvData exists and is not empty if (!csvData) { console.log("Input data structure:", $json); // Debugging output to inspect input structure throw new Error('No CSV data provided. Ensure the correct field reference is being used.'); }
// Split the CSV into rows const rows = csvData.split('\n');
// Extract the headers const headers = rows[0].replace(/"/g, '').split(',');
// Iterate over each data row and map it to an object const output = rows.slice(1).map(row => { const values = row.match(/(".?"|[^",]+)(?=\s,|\s*$)/g).map(value => { // Remove surrounding quotes from each value if present return value.startsWith('"') && value.endsWith('"') ? value.slice(1, -1) : value; });
const item = {}; headers.forEach((header, index) => { item[header] = values[index] || null; });
return { json: item }; });
return output;
Campaign Analytics Report Documentation
Campaign Analytics Report Documentation
Overview
This report provides a high-level summary of campaign performance, designed to help stakeholders quickly assess the outcomes of marketing or sales campaigns. It includes data on campaign activity, targeted audiences, and progression metrics, allowing for a holistic view of campaign effectiveness.
Key Metrics
1 **Campaign Identification and Status**
• Campaign ID: A unique identifier assigned to each campaign for tracking purposes.
• Status: Indicates the current state of the campaign:
• Active: Campaign is ongoing.
• Paused: Campaign is temporarily on hold.
• Archived: Campaign has concluded.
2 Targeting and Reach
• Total Companies: Number of companies targeted within the campaign scope.
3 Pipeline Metrics
• Lead Count: Total number of leads generated by the campaign.
• Marketing Qualified Leads (MQLs): Leads that meet predefined marketing qualification criteria.
• Sales Qualified Leads (SQLs): Leads that are validated as sales-ready by the team.
• Opportunities: Potential deals created from campaign engagement.
• Customers: Number of deals successfully closed, converting leads into customers.
4 Lifecycle Stages
• Lifecycle Stage Metrics: Counts of entities (e.g., leads, opportunities, or customers) at specific lifecycle stages. These stages represent the journey from lead generation to conversion.
How to Use This Report
• **Evaluate Campaign Success**: Compare metrics like total companies, leads, and customers to understand campaign impact.
• **Understand Pipeline Health**: Analyze how many entities progress through the funnel (e.g., from MQL to SQL to Opportunity).
• **Monitor Campaign Status**: Use the status column to focus on active campaigns or review the outcomes of archived ones.
• **Assess Engagement**: Check opportunity and customer counts to gauge how effective the campaign is in driving conversions.
HUBSPOT LIFECYCLESTAGE (LEAD STATUS)
HUBSPOT LIFECYCLESTAGE (LEAD STATUS)
Purpose and structure
This folder contains the HUBSPOT LIFECYCLESTAGE (LEAD STATUS) workflow. Its executable nodes use code, googleSheets, httpRequest, hubspot, if, merge, postgres, scheduleTrigger, set, splitInBatches. 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
Schedule Trigger
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/0655_Code_Postgres_Update_Scheduled.json MIT; preserve source notices.
Canvas section labels
These name areas of the original canvas; they do not include explanatory instructions.
- HUBSPOT LIFECYCLESTAGE (LEAD STATUS)
- SMARTLEAD CAMPAIGN DATA
- Search for your smartlead API key [here](https://app.smartlead.ai/app/settings/profile)
- POSTGRES INSTALATION [Guide](https://github.com/wukimidaire/postgres_table_templates)