Cloudflare
Accounts, zones, DNS records (agent create/update only for allowlisted names, delete node only), cache purge (node only), Workers with settings and deployments
Beta v0.1.0 Node.js 15 actions
About
A Graphrt plugin for the Cloudflare API v4. It reads accounts and zones, lists and changes DNS records, purges the cache from workflow nodes, and lists Workers with their settings and deployments. It is built with the declarative REST layer (definition.mjs).
What it can do
- Token, accounts, zones: verify_token (user tokens), verify_account_token (account-owned tokens, which verify_token rejects), list_accounts, list_zones, get_zone
- DNS: list_dns_records, get_dns_record, create_dns_record, update_dns_record, delete_dns_record (node only)
- Cache: purge_cache (node only): everything, or by URLs, cache tags, hostnames or prefixes
- Workers: list_workers, get_worker_settings (bindings by name and type, secret values are never returned), list_worker_deployments
- api_request: any other v4 endpoint, e.g. /zones/<zone_id>/settings (agents: GET only, on an allowlist)
Actions
Each action is a step you can add to a workflow. Agents can also use most of them as tools.
- Verify API token
cloudflare.verify_token - Verify account API token
cloudflare.verify_account_token - List accounts
cloudflare.list_accounts - List zones
cloudflare.list_zones - Get zone
cloudflare.get_zone - List DNS records
cloudflare.list_dns_records - Get DNS record
cloudflare.get_dns_record - Create DNS record
cloudflare.create_dns_record - Update DNS record
cloudflare.update_dns_record - Delete DNS record
cloudflare.delete_dns_record
Show all 15 actions
- Purge cache
cloudflare.purge_cache - List Workers
cloudflare.list_workers - Get Worker settings
cloudflare.get_worker_settings - List Worker deployments
cloudflare.list_worker_deployments - Cloudflare API request
cloudflare.api_request
Settings
Graphrt starts plugins with a clean environment. Only these values reach the plugin, and secrets stay out of logs.
-
CLOUDFLARE_API_TOKENRequiredAPI token (Authorization: Bearer). Global API keys are not supported. -
CLOUDFLARE_TOOL_ALLOW_WRITEOptional1 lets agent tools create and update DNS records named in the next variable -
CLOUDFLARE_TOOL_DNS_ALLOWED_NAMESFor tool DNS writesDNS names agents may create/update: api.example.com, *.preview.example.com -
CLOUDFLARE_TOOL_API_EXTRA_PATHSOptionalMore read paths for agent api_request, comma-separated, * = one segment
How to use it
In Graphrt Desktop
- Open Plugins and search for Cloudflare.
- Click Install and approve it.
- Follow the setup steps on the plugin's page, then paste the settings it needs.
- Describe a job that needs it, and the builder adds the steps.
With the CLI
terminal
$ graphrt plugin install cloudflare workflow.yaml
- id: zone
type: cloudflare.list_zones
name: example.com
- id: record
type: cloudflare.list_dns_records
zone_id: "{{#zone.data.0.id#}}"
record_type: A
name: api.example.com
- id: repoint
type: cloudflare.update_dns_record
zone_id: "{{#zone.data.0.id#}}"
record_id: "{{#record.data.0.id#}}"
content: 198.51.100.7