Looking to build a workflow for Klaviyo that can take information from a previous node (i.e Google Sheet) and sends that information via an HTTP Request to Klaviyo. The goal would be to kick off an email with a premade template that replaces the name and a dynamic link based on information from Google Sheets.
And the email of course would be provided to kick off the initial email.
All I’m getting in the last node (HTTP Request) is just data [0] so it doesn’t look like anything is being passed to Klaviyo and I don’t see any sends on Klaviyo’s end so something is broken.
Currently I’m built a simple workflow with a Webhook so I can send the data via Postman (name, email and URL).
I am afraid the link you have shared requires a login. Perhaps you can copy the workflow from your n8n instance by first selecting all relevant nodes, then copy them using Ctrl+C? After redacting anything confidential you can then post the workflow here on the forum.
In addition, to make sure you’re using the latest version of n8n’s ai-beta image and make sure we’re on the same page, can you head over to your n8n cloud dashboard and click the Restart workspace button at the bottom?
So from testing, you’re definitely sending a valid HTTP Request here, I quickly tested this using webhook.site and a slightly modified version of your workflow without the webhook node:
So I very much suspect this is just a minor issue with the data being sent in the wrong format or something along these lines.
Do you have a the request you’re making in the HTTP Request node working outside of n8n (for example curl or Postman) by any chance? If so, can you share it using the cURL format (of course with redacted data again to avoid sharing anything secret)?
If not, can you share a link to the respective API documentation?
Nevermind @First_Spark_Digital , I think I found it. They seem to expect the data in a single data field in the body of your request rather than through query parameters.
This should work like so in n8n:
This comes through in my free Klaviyo account as expected (using a valid public API key of course):
Keep in mind that the response is supposed to be more or less empty as per their docs, so you wouldn’t get much in n8n unless you enable the “Include Response Headers and Status” option of the HTTP Request node:
Oh, I just mean their API isn’t very talkative. Kind of what you have seen when you encountered your { "data": 0 } error response. Nothing to worry about, but definitely something to keep in mind when working with it.
Also wondering if it’s possible with this HTTP Request leverage to send an email from an existing workflow.
Looks like it. Klaviyo document how to trigger a campaign to send asynchronously here:
You can copy the curl request they provide in their docs and import it in n8n’s HTTP Request node using the Import cURL button:
Super helpful! Thank you. Need to just sort out the Code (prior node) to pull in the data from the Google Sheets node so I can have it pull dynamically the name and URL.
Realized I didn’t even need to have the node kick start a workflow. Simply adding to a list is the easiest way to get them in a workflow.
However now I’m running into an issue where it keeps saying:
ERROR: Authorization failed - please check your credentials
401 - “{"errors":[{"id":"ebf1dad3-0c08-4fd1-ad01-33aeb1be51c7","status":401,"code":"not_authenticated","title":"Authentication credentials were not provided.","detail":"Missing or invalid authorization scheme. Please use Klaviyo-API-Key.","source":{"pointer":"/data/"}}]}”
Hi @First_Spark_Digital, you might need to remove the Authorization value from your “Header Parameters” list if you’re also sending an Authorization header through your credentials.
Also, can you confirm you are sending a value like Klaviyo-API-Key your-private-api-key for your Authorization header? This private key is different from the public key previously used and would need to be created explicitly on the respective Klaviyo screen: