Klaviyo icon

Klaviyo

Interact with the Klaviyo API

Actions17

Overview

The node interacts with the Klaviyo API to retrieve multiple metric records ("Get Many" operation on the "Metric" resource). It allows users to fetch a list of metrics with optional pagination, filtering, and selection of specific fields. This is useful for analytics, reporting, or monitoring scenarios where you want to programmatically access metric data from Klaviyo.

Practical examples include:

  • Retrieving all metrics related to specific integrations filtered by category or name.
  • Paginating through large sets of metrics using a page cursor.
  • Including additional related resources such as flow triggers to enrich the metric data.
  • Selecting only relevant fields to optimize data transfer and processing.

Properties

Name Meaning
Page Cursor A string token used for pagination to fetch the next page of results.
Filters Allows adding one or more filters based on integration properties. Each filter consists of:
- Integration: Choose between filtering by integration category or integration name.
- Value: The value to match exactly.
Metric Fields Select which fields of the metric resource to return. Options include: name, created, updated, integration. At least one field must be selected.
Additional Resources Specify related resources to include in the response. Currently supports including flow-triggers to get associated flow trigger data along with metrics.
Flow Fields When flow-triggers is included in Additional Resources, select which fields of the flow resource to return. Options include: name, status, archived, created, updated, trigger_type.

Output

The node outputs JSON data representing an array of metric objects retrieved from the Klaviyo API. Each metric object contains the fields requested via the "Metric Fields" property. If "Additional Resources" includes flow-triggers, the output will also contain related flow trigger data with the selected "Flow Fields".

If binary data were involved (not applicable here), it would represent file or media content, but this node deals exclusively with JSON data.

Dependencies

  • Requires an API key credential for authenticating with the Klaviyo API.
  • The node sends requests to the base URL: https://a.klaviyo.com/api.
  • Proper configuration of the API key credential in n8n is necessary for successful authentication.

Troubleshooting

  • Empty Results: If no metrics are returned, verify that filters are correctly set and that the API key has access to the requested data.
  • Invalid Pagination Token: Using an incorrect or expired page cursor may result in errors or empty responses. Ensure the cursor is obtained from a previous valid response.
  • Missing Required Fields: The "Metric Fields" property is required; omitting it may cause the request to fail or return incomplete data.
  • API Rate Limits: Excessive requests may hit Klaviyo's rate limits; handle errors gracefully and implement retries or delays if needed.
  • Authentication Errors: Ensure the API key credential is valid and has sufficient permissions.

Links and References

Discussion