Looking for n8n Expert to build AI Sales Agent with OpenAI & HubSpot!

Hi everyone, I love this community!

I am looking for a freelancer to help me optimize my current workflow. I have a basic setup running, but it fails randomly.

The Project:
I need to connect a Webhook from my landing page to HubSpot CRM. After the data is received, I want to use the OpenAI node to analyze the lead’s intent and draft a personalized email.

Requirements:

  • Strong experience with n8n self-hosted.
  • Familiarity with PostgreSQL for logging events.
  • Understanding of JSON data structures and Javascript in the Code Node.
  • Experience with error handling (try/catch blocks).

Current Issue:
My workflow works for simple text, but when the API response contains nested JSON arrays, the Split In Batches node breaks.

If you are interested, please send me a DM with your portfolio and hourly rate.

Thanks!

5 Likes

If you need I am available here:

Here is my portfolio:

I’m also a full-stack developer with the right Gen AI experience, which makes me a solid plus for your team[but right now only vibecoding]

Check my recent gen ai projects… I built a native Android automation agent too. It’s worth a look:

I can build complex AI automations directly in code, not just inside n8n.

I recently started posting my n8n work on YouTube with explanations:

Fun fact… I even made an n8n workflow to find a few n8n project leads for myself :skull::skull::skull: so I truly believe in what I do…


I started asking My recent clients for honest feedbacks so here is one testimonial: https://www.youtube.com/watch?v=TqBy3SVCHgQ&list=PLAJltY5bp6yiZ3sFBjm7bfrkLXSGtJX8m

Here is my linktree: iamvaar | X | Linktree

I am open for any remote opportunity such as part-time, full-time, project basis, being a co-founder for your automation agency, hourly basis and any opportunity…

My rate for whatever opportunity is 45$/hr

I am capable of developing custom n8n nodes too..
https://www.npmjs.com/package/n8n-nodes-pdfbro

https://www.npmjs.com/package/n8n-nodes-ocrbro

https://www.npmjs.com/package/n8n-nodes-ttsbro

1 Like

hey @uNavy
I’ve been working with n8n (self-hosted) for a while now and have hands-on experience with HubSpot integrations, PostgreSQL event logging, and JavaScript in Code nodes.

I have sent you my portfolio in dm.

lets connect!

Hi uNavy,

This is a very familiar issue — I’ve handled it multiple times in self-hosted n8n setups.

I’m a Certified n8n Developer (Level 1 & 2) and have built production AI sales and CRM workflows with HubSpot, OpenAI, PostgreSQL logging, and custom Code Node (JavaScript) handling.

Regarding your current problem:
The Split In Batches node breaking on nested JSON arrays is a known pitfall. This should be handled by normalizing the payload first (Code Node / Item Lists), explicitly mapping arrays into flat iterable items, or restructuring the OpenAI response before batching. I also usually add guards to prevent malformed API responses from killing the run.

I can help you:

  • Stabilize the workflow

  • Add proper try/catch + fallback paths

  • Implement Postgres logging

  • Make the OpenAI output deterministic and safe for downstream nodes

Happy to share relevant examples and my hourly rate via DM.

Let’s discuss.
— Muhammad

Moosa, how can we connect?

You can dm me @Parker_Jackson

You’re close — the random failures usually come from inconsistent payload shapes, not the OpenAI node itself. The safe fix is to normalize the nested arrays into a predictable list before Split In Batches, and to guard every “maybe-array” field with a fallback in a Code node.

  • Add a Code node right before Split In Batches to coerce the field into an array (or an empty array) and flatten nested arrays into a single list.

  • Wrap downstream nodes with explicit checks (length, undefined/null) and route “empty/invalid payload” to a logging + alert branch instead of letting the run crash.

  • Log every run to Postgres with a correlation id (webhook request id) + the normalized payload shape so you can replay failures deterministically.

We do this kind of self-hosted n8n hardening at Hashlogics, including HubSpot + OpenAI + Postgres logging patterns like the Automated ESG & Sustainability Engine and Agentic Automations on IRS Escape Plan implemented for QA.tax

My CV:star: Reviews

If you share one sample of the nested JSON (redacted), I can tell you exactly what to normalize and where Split In Batches is choking.

Hi! I’m an n8n specialist with 3 years building production workflows - this is exactly what I do.

I’ve solved the exact issue you’re describing (Split In Batches with nested JSON) multiple times. It usually requires proper JSON parsing before the split node and handling array depth correctly.

Strong experience with:

  • n8n self-hosted (30+ production workflows)
  • PostgreSQL event logging
  • OpenAI node integration and error handling
  • JavaScript Code Node for complex data transformations
  • HubSpot CRM integrations
  • Production-grade error handling with try/catch and retry logic

I can debug your current workflow and implement a stable solution with proper error handling and logging.

Sending you a DM with portfolio and rate.

Email: iuri.reists@gmail.com
WhatsApp: +55 11 95174-9848
LinkedIn: linkedin.com/in/iuri-reis-124918181

Hi,

Sounds like a solid workflow you are building there.

I have extensive experience with n8n self-hosted, PostgreSQL event logging, and working with complex JSON structures in the Code Node.

Would be happy to take a look and get things running smoothly for you.

You can reach out to me on my email here

Colin

Hi @Muhammad_Bin_Zohaib , I’d be happy to help optimize and fix your workflow. I have extensive experience with n8n and have worked on projects involving Webhooks, HubSpot CRM, and OpenAI integrations. I understand the issue with the Split In Batches node and can certainly help resolve the error with nested JSON arrays.

Please feel free to share more details, and I’ll be able to provide a solution tailored to your workflow.

:telephone_receiver: Book a quick call:Calendly - Automaxion

Looking forward to hearing from you!

We can help you resolve this in 3 hours. You can book a meeting with us: Calendly

Experienced n8n & AI Architect based in Toronto (EST) :canada:

Hi @uNavy, I specialize in building Production-Ready AI Ecosystems using n8n, ranging from secure RAG pipelines to Multi-Agent strategic systems.

I’ve built several “Headless AI” frameworks that decouple business logic from the UI. You can view my live project gallery and technical portfolio here:

Portfolio & Case Studies

Looking forward to discussing how I can automate this for you! I can be reached at (kenjliang@gmail.com)

Thanks,
Ken

Hey @uNavy — I build AI sales agents with OpenAI + HubSpot via n8n, including webhook-to-CRM flows with AI-based intent analysis and personalized email drafting. Portfolio: https://www.theurgicai.com/ | Rate: $70/hr. Happy to jump on a call — when works for you?

Hi! This is exactly my stack — n8n self-hosted, PostgreSQL, OpenAI, JavaScript in Code nodes.

The nested JSON array issue with Split In Batches is a common one — usually fixed by flattening the array before the node or using a Code node to iterate manually. I’ve solved this pattern multiple times.

I’ve built production workflows: lead intake from Meta Ads → CRM → AI analysis → WhatsApp notifications. All with proper error handling and PostgreSQL logging.

Portfolio: https://contra.com/artem_ryabov_pknp07h3

Rate: $35/hour. Happy to jump on a quick call to look at your current workflow.

Artem

This is a classic stack I’ve built before — webhook → n8n → HubSpot → OpenAI → personalized outreach.

For the random failures on self-hosted n8n, the most common culprits are: webhook timeout mismatches, missing error branches on the OpenAI node, and HubSpot API rate limits hitting without retry logic. All fixable.

I can audit your current workflow, stabilize it, and extend it to include PostgreSQL event logging as you described. I work with self-hosted n8n deployments specifically — not just cloud.

Drop me a message at salimoulhaj1@gmail.com or reply here and we can take a look.

Hi!

I saw your post about the n8n + HubSpot workflow. The issue with Split In Batches breaking on nested arrays is a classic — it usually happens because the node expects a clean array of objects, but gets a complex nested structure.

I’m an automation engineer and I can fix this for you by using a custom Code Node (JavaScript) to “flatten” your JSON before it hits the batches.

Why I’m the right fit:

  • Code-First Approach: I don’t just use basic nodes. I write custom JS to handle complex JSON structures and edge cases.

  • PostgreSQL & Logging: I always use Postgres for event logging. It’s the only way to build a production-grade system where you can actually see why a lead failed.

  • Bulletproof Error Handling: I’ll set up a Global Error Workflow and specific try/catch blocks so your scenario stops “randomly failing” and starts sending you alerts instead.

  • OpenAI Optimization: I’ve built many AI-driven lead filters. I’ll make sure the prompt is optimized to extract intent accurately even from messy landing page data.

My Portfolio: https://mikedevai.netlify.app/ Hourly Rate: $40

I can hop on a quick call today, look at your JSON structure, and give you a fix.

Contacts:

  • Telegram: @hely_chatbots

  • WhatsApp: +375293761570

Let’s get this workflow stable!

Hi uNavy,

The Split In Batches node breaking on nested JSON arrays is a textbook case — the node expects a flat array at the input path, and when the OpenAI response returns a nested structure, the inner arrays are not unwrapped before batching.

Two ways I would fix it:

  • Inline: insert a Code node between OpenAI and Split In Batches that flattens the response to the exact level the batcher expects, with a try/catch around the JSON parse so a malformed LLM output is sent to a dead-letter queue instead of crashing the run
  • Structural: if the nested output is meaningful (e.g. multi-intent leads), use a Code node to split into one item per intent and let Split In Batches operate on those — each batch is then a clean, single-intent lead

On the broader sales-agent flow, the pattern I would layer on top is schema validation at the LLM boundary — a typed model for the “intent + urgency + recommended email draft” output so your HubSpot writes never receive malformed data.

Reference repo with that pattern:

DM me when you want the fix shipped or the hardening scoped.

Priyanshu Kumar
AI & Automation Engineer

https://www.linkedin.com/in/priyanshu-axiom

Hi uNavy,

The random failure you described sounds like a payload-contract problem before Split In Batches, not just a HubSpot or OpenAI issue.

First proof:

landing-page webhook sample → normalize nested JSON into a stable lead schema → HubSpot review/upsert queue + Postgres event/error log

That tests the exact requirements you named: self-hosted n8n, JS Code node normalization, deterministic logging, malformed response handling, and no bad HubSpot writes from nested arrays.

I work async-only and fixed-scope. If this is still open, send one redacted webhook payload, the HubSpot fields that should be written, and one failed execution screenshot. I can scope a first stabilization patch in writing.

I can also show a small public proof shape for the normalization ledger if you want to see the artifact format before sending anything sensitive.

Alex Reed
WorkflowPatch
alex@workflowpatch.com

Hi, I can help debug and harden this.

The nested JSON array issue sounds like a focused fix: normalize the webhook/OpenAI response shape before Split In Batches, add validation in a Code node, log payloads to PostgreSQL, and make the HubSpot/email path fail explicitly instead of randomly breaking.

A good first paid milestone would be: reproduce the failure with sample payloads, fix the transformation/batching logic, add basic error handling, and leave notes so future lead-intent fields do not break the flow again.

Happy to DM hourly/fixed options.

Hi,

The nested JSON issue with Split In Batches is a common one — the node expects a flat array and breaks when it hits arrays within arrays. Fix is straightforward: parse and flatten the nested structure in a Code node before it hits Split In Batches, then pass clean objects downstream. Happy to show you exactly how.

I work with n8n self-hosted, HubSpot, OpenAI, and PostgreSQL logging regularly — this is a quick fix plus a cleaner rebuild of the error handling layer around your webhook intake.

Check dm I have sent my portfolio and rate.

-– Aryan