``Aggregate `amount_captured` ``
Configured with HTTP Request, Hubspot, Item Lists, Schedule Trigger, and additional nodes. Review the connections and setup before adapting this template.
Node categories in this workflow
- Routing
- Integration
- Trigger
- Transform
- Code
- 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 |
|---|---|---|---|
| If charge has customer | Routing | If | See node parameters |
| Get customer | Integration | Stripe | customer |
| On schedule | Trigger | Schedule Trigger | See node parameters |
| Remove duplicate customers | Transform | Item Lists | removeDuplicates |
| Aggregate `amount_captured` | Transform | Item Lists | aggregateItems |
| Aggregate totals | Code | Code | See node parameters |
| Create or update customer | Integration | Hubspot | contact |
| Merge data | Transform | Merge | See node parameters |
| Get all charges | Integration | Stripe | charge / getAll |
| Get HubSpot field | Web / API | HTTP Request | See node parameters |
| Create field in HubSpot | Web / API | HTTP Request | POST |
| Configure | Transform | Edit Fields | See node parameters |
| Skip field checking | Routing | If | See node parameters |
| Do nothing | Routing | No Op | See node parameters |
| If field exists | Routing | If | 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
hubspotOAuth2ApistripeApi
Workflow notes
`Merge data`
Merge data
More specifically, we merge the Stripe data from Get charges and Get customer nodes. Only the charges with customers on them will continue.
`Aggregate totals`
Aggregate totals
Given the merged data, we now aggregate the amounts from charges to the customers/contacts.
``Aggregate `amount_captured` ``
Aggregate `amount_captured`
This does nothing. It is an alternative way to find the totals of every charge in existence in Stripe. Potentially useful for debugging purposes.
Sync Stripe charges to HubSpot contacts
Sync Stripe charges to HubSpot contacts
This workflow pushes Stripe charges to HubSpot contacts. It uses the Stripe API to get all charges and the HubSpot API to update the contacts. The workflow will create a new HubSpot property to store the total amount charged. If the property already exists, it will update the property.
How it works
- On a schedule, the first Stripe node gets all charges. The default schedule is once a day at midnight.
- Once the charges are returned, the second Stripe node gets extra customer information.
- Once the customer information is returned,
Merge datanode will merge the customer information with the charges so that the next nodeAggregate totalscan calculate the total amount charged per contact. - Once we have the total amount charged per contact, the
Create or update customernode will create a new HubSpot property to store the total amount charged. If the property already exists, it will update the property.
Workflow written by David Sha.
`Remove duplicate customers`
Remove duplicate customers
Ensures that we do not poll Stripe too many times unnecessarily. If multiple charges have the same customer, we ensure that we do not ask for the same information again.
Create HubSpot field if required
Create HubSpot field if required
These nodes create a HubSpot field if required.
It makes the contact field that this workflow uses
to store the Stripe information. To disable this
section, in Configure node change checkFields
to false.
Configuration
Configuration
By default, this does not need to be updated.
contactPropertyId (required): Only change if the specific HubSpot field ID has been taken.
contactPropertyLabelName (required): Change if you would like a different display name.
checkFields (required): Turn to false if you would like to optimise this workflow, provided this workflow has run once before with this configurable enabled. This will disable the section of this workflow which deals with creating a HubSpot field.
`Create or update customer`
Create or update customer
By default, the only field updated is "Stripe - Total Spend". The contact is identified by its email.
`Do nothing`
Do nothing
This is useful to know what Stripe charges had no customer assigned.
``Aggregate `amount_captured` ``
Aggregate `amount_captured`
Purpose and structure
This folder contains the Aggregate `amount_captured` workflow. Its executable nodes use code, httpRequest, hubspot, if, itemLists, merge, noOp, scheduleTrigger, set, stripe. 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 schedule
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/0288_Code_Schedule_Create_Webhook.json MIT; preserve source notices.