Cloudflare Analytics icon

Cloudflare Analytics

Cloudflare Analytics graphql

Overview

This node integrates with Cloudflare Analytics via GraphQL to fetch analytics data for one or more selected Cloudflare accounts over a specified time range. It is useful for users who want to automate the retrieval of detailed analytics data from their Cloudflare accounts within n8n workflows.

Typical use cases include:

  • Aggregating analytics data across multiple Cloudflare accounts.
  • Fetching analytics for custom date ranges or predefined time periods.
  • Automating reporting and monitoring of website performance metrics hosted on Cloudflare.

For example, a user can select specific accounts or all accounts, choose a time period such as "Last 7 days" or specify a custom date range, and then retrieve the corresponding analytics data for further processing or visualization.

Properties

Name Meaning
账户选择 Names or IDs (accountNames) Select one or multiple Cloudflare accounts by name or ID. Options are dynamically loaded. "ALL" selects all accounts. Required.
时间选择 Name or ID (timeSelect) Choose a predefined time period or specify an ID for the time range. Options are dynamically loaded. Required.
选择开始日期 (dateStart) Start date for a custom date range. Only shown if a custom time range option is selected. Date only (no time).
选择结束日期 (dateEnd) End date for a custom date range. Only shown if a custom time range option is selected. Date only (no time).

Output

The node outputs an array of items where each item contains:

  • json.dateRange: An object representing the resolved date range used for the query, including start and end dates.
  • json.accounts: An array of analytics data objects, each corresponding to a Cloudflare account queried. Each object contains the analytics data retrieved from the Cloudflare GraphQL API for that account.

If multiple accounts are selected, the output aggregates the analytics data for all those accounts in the accounts array.

No binary data output is produced by this node.

Dependencies

  • Requires valid Cloudflare API credentials (email and API key) configured in n8n to authenticate requests.
  • Depends on external Cloudflare GraphQL API endpoints to fetch analytics data.
  • Uses helper methods internally to load account names and dynamic time options.

Troubleshooting

  • Authentication errors: If the node fails due to invalid credentials, verify that the provided Cloudflare email and API key are correct and have sufficient permissions.
  • No accounts found: Ensure that the Cloudflare account associated with the credentials has accessible accounts and that the account names selected exist.
  • Invalid date range: When using a custom date range, ensure the start date is before the end date and both are valid dates.
  • API rate limits: Cloudflare may impose rate limits; if you encounter errors related to request limits, consider adding delays or reducing the number of accounts queried simultaneously.
  • Continue on Fail: If enabled, the node will continue processing other items even if one fails, otherwise it will throw an error stopping execution.

Links and References

Discussion