Actions5
- Database Actions
- Query Actions
Overview
This node allows you to manage Cloudflare D1 serverless SQL databases by performing operations such as creating, deleting, and listing databases. Specifically, the Create Database operation lets you create a new D1 database within your Cloudflare account.
Typical use cases include automating database provisioning workflows, integrating database creation into CI/CD pipelines, or managing multiple D1 databases programmatically without manual intervention in the Cloudflare dashboard.
For example, you might use this node to automatically create a new database for each customer signup in a SaaS application, specifying location hints to optimize latency based on user geography.
Properties
| Name | Meaning |
|---|---|
| Database Name | The name of the D1 database to create. |
| Additional Options | Optional settings for the database creation. Currently supports: |
| - Primary Location Hint | A string hint indicating the primary geographic location for the database (e.g., "wnam" for Western North America). |
Output
The output JSON contains the result of the database creation request:
- For a successful creation, it returns the details of the newly created database as provided by the Cloudflare API.
- The output is structured as an object with database properties such as its unique ID, name, and possibly other metadata returned by the API.
- If the operation fails, the output will contain error information including the error message and HTTP status code if
continueOnFailis enabled.
No binary data is produced by this operation.
Dependencies
- Requires a valid Cloudflare API key credential with permissions to manage D1 databases.
- The node communicates with the Cloudflare REST API endpoint at
https://api.cloudflare.com/client/v4. - You must configure the node with your Cloudflare account ID and API token.
- No additional external dependencies are required beyond the Cloudflare API access.
Troubleshooting
- Database Not Found Error: When attempting to delete a database by name, if the database does not exist, the node throws an error stating the database was not found. Ensure the database name is correct and exists in your Cloudflare account.
- Invalid Parameters JSON: For query operations (not relevant here), invalid JSON in parameters causes errors. For create operation, ensure all inputs are correctly formatted.
- API Authentication Errors: If the API token or account ID is incorrect or lacks permissions, requests will fail. Verify your credentials and their scopes.
- Rate Limits or Network Issues: The Cloudflare API may rate limit requests or experience downtime. Retry logic or error handling should be implemented accordingly.
- Primary Location Hint: Providing an invalid or unsupported location hint may cause the API to reject the request. Use documented location codes.