Hi everyone,
I’m building a workflow in n8n (Version 1.103.2) to generate Instagram stories from Google Sheets data, using GPT/Claude for content, Bannerbear for images, and uploading to Google Drive. However, I’m running into persistent errors in a few nodes, and I’ve tried several fixes but could use some community help.
Main Issues:
-
AI Agent Node: Often fails with “Error in sub-node ‘Structured Output Parser’” – the model output doesn’t fit the schema (e.g., wrapped in “output” or violating length/hashtag rules). I’ve optimized the prompt and schema (added defaults, allowed additionalProperties), set “On Error” to “Continue (using error output)”, and added fallback code, but it still happens on some items.
-
Structured Output Parser: Related to the above – model outputs sometimes have extra keys or invalid formats. Auto-Fix is enabled, but not always helping.
-
Download Image1 Node (HTTP Request): Gets “Invalid URL” error when trying to download from Bannerbear’s image_url. The URL seems empty or malformed sometimes. I’ve added an IF-Node to check if it’s not empty and starts with “https://”, with a fallback branch, but the workflow still breaks occasionally.
What I’ve Tried:
- Optimized AI prompt for strict JSON output (no wrappers, escapes, limits).
- Updated schema with defaults (“” for missing fields), minItems:0 for hashtags, pattern tolerant for hashtags.
- Added Code-Nodes for manual fixing (e.g., remove wrappers, truncate strings).
- Set “On Error” to “Continue” in critical nodes.
- Tested with single items (batch size 1 in Loop).
- Checked credentials (OpenAI, Bannerbear, Google Sheets/Drive) – all valid.
- Enabled debug logs, but no clear cause.
The workflow runs partially (e.g., up to Bannerbear), but fails on certain sheet rows. Here’s my full workflow JSON (imported from n8n):
[Click the </> button and paste your full JSON here from the initial message, e.g.:
{
“name”: “Instagram-stories-workflow”,
“nodes”: [ … ] // the entire JSON
}
]
Any ideas on how to make it more robust? Maybe better prompt/schema tweaks or Bannerbear polling? Thanks in advance!
Best,
Thomas