Overview
This node integrates with Cloudflare Analytics via GraphQL to fetch analytics data for specified Cloudflare accounts over a selected time range. It is useful for users who want to automate the retrieval and processing of Cloudflare analytics data within their workflows, such as monitoring website traffic, performance metrics, or security events.
Typical use cases include:
- Aggregating analytics data from multiple Cloudflare accounts.
- Fetching data for custom date ranges or predefined time periods.
- Automating reports or dashboards that rely on Cloudflare analytics.
For example, a user can select one or more Cloudflare accounts and specify a time period (e.g., last 7 days, last month, or a custom date range) to retrieve detailed analytics data automatically.
Properties
| Name | Meaning |
|---|---|
| 账户选择 Names or IDs (accountNames) | Select one or multiple Cloudflare accounts by name or ID. Optionally choose "ALL" to select all accounts. |
| 时间选择 Name or ID (timeSelect) | Choose a predefined time period or specify a custom time range for analytics data retrieval. Options are dynamically loaded. |
| 选择开始日期 (dateStart) | Start date for a custom date range. Only shown if a custom time range is selected. |
| 选择结束日期 (dateEnd) | End date for a custom date range. Only shown if a custom time range is selected. |
Output
The node outputs an array of items where each item contains:
json.user.email: The email associated with the API credentials used.json.dateRange: The resolved date range object withdateStartanddateEndfields representing the selected time period.json.accounts: An array of analytics data objects, each corresponding to a Cloudflare account queried. Each object contains the analytics data returned from the Cloudflare GraphQL API for that account.
If multiple accounts are selected, the output aggregates analytics data for all those accounts in the accounts array.
No binary data output is produced by this node.
Dependencies
- Requires an API key credential for authenticating with Cloudflare Analytics API.
- The node uses helper methods to:
- Retrieve Cloudflare accounts accessible by the authenticated user.
- Query Cloudflare Analytics data via GraphQL.
- No additional external dependencies beyond the Cloudflare API and n8n's credential system.
Troubleshooting
Common issues:
- Invalid or missing API credentials will cause authentication failures.
- Selecting accounts that the API key does not have access to will result in empty or error responses.
- Incorrect date ranges (e.g., start date after end date) may cause errors or no data returned.
Error messages:
- Errors thrown during API calls are wrapped as node operation errors with context about the item index.
- If "Continue On Fail" is enabled, errors for individual items are captured in the output with an
errorfield.
Resolutions:
- Verify that the API key has sufficient permissions to access the desired Cloudflare accounts.
- Ensure date ranges are valid and properly formatted.
- Use the "Continue On Fail" option to handle partial failures gracefully.
Links and References
- Cloudflare Analytics API Documentation
- n8n Expressions Documentation (for specifying dynamic inputs)
- n8n Credential Management