HttpRequest Automate

Automated workflow for Smartlead that efficiently extracts campaign data, updates PostgreSQL records, and integrates with HubSpot and Google Sheets. It runs on a schedule, processes data in batches, and provides comprehensive campaign analytics, enhancing decision-making and improving marketing effectiveness.

7/8/2025
23 nodes
Complex
schedulecomplexsplitinbatchespostgresqlhubspotschedule triggersticky notegooglesheetsautomationadvancedapiintegrationdatabasedatalogicconditionalcron
Categories:
Schedule TriggeredComplex WorkflowData Processing & AnalysisCRM & Sales
Integrations:
SplitInBatchesPostgreSQLHubspotSchedule TriggerSticky NoteGoogleSheets

Target Audience

Target Audience


- Marketing Teams: Those looking to automate lead extraction and campaign management.
- Sales Teams: Users who need to track lead status and campaign performance effectively.
- Data Analysts: Individuals responsible for analyzing campaign data and generating reports.
- Business Owners: Entrepreneurs who want to streamline their marketing efforts and enhance customer engagement.
- Developers: Tech-savvy users who want to integrate various APIs and databases into their workflows.

Problem Solved

Problem Solved


This workflow addresses the challenge of manually extracting campaign data and managing leads across multiple platforms. It automates the process of fetching campaign information, updating databases, and integrating with HubSpot, thereby saving time and reducing human error. By automating these tasks, teams can focus on strategy and execution rather than repetitive data entry.

Workflow Steps

Workflow Steps


1. Schedule Trigger: The workflow initiates based on a defined schedule, ensuring regular data updates.
2. Set Smartlead API Key: The API key is set to authenticate requests to the Smartlead API.
3. Fetch All Campaigns: Retrieves a list of all campaigns from the Smartlead API.
4. Loop Over Items: Iterates through each campaign to extract specific data.
5. Extract Campaign Data: For each campaign, it fetches detailed lead data using the campaign ID.
6. Update Campaign: Updates the campaign information in the PostgreSQL database.
7. Merge Data: Combines the extracted lead data for further processing.
8. Code Execution: Processes the CSV data into a structured format for easier database manipulation.
9. Loop Over Items1: Iterates through the processed lead data for further actions.
10. HubSpot Integration: Retrieves additional data from HubSpot for leads.
11. Conditional Logic: Checks if certain conditions are met before proceeding with updates.
12. UPSERT Campaign Activity: Updates or inserts campaign activity data into the PostgreSQL database.
13. Google Sheets Update: Appends or updates the campaign performance data in a Google Sheets document for reporting.

Customization Guide

Customization Guide


- API Key: Replace << ADD YOUR API KEY HERE >> with your actual Smartlead API key to enable data fetching.
- Schedule Configuration: Adjust the Schedule Trigger parameters to set how frequently the workflow runs (e.g., daily, weekly).
- Database Connection: Modify PostgreSQL connection settings to point to your database instance.
- HubSpot Integration: Ensure that your HubSpot credentials are properly configured to access lead data.
- Data Mapping: Customize the data mapping in the UPSERT and UPDATE operations to fit your database schema.
- Error Handling: Implement additional error handling in the code sections to manage unexpected data formats or API issues.