Portal Community

dns/batchCreate

Create multiple DNS records in a single API call. Partial success is possible — always check the errors array.

Partial success: dns/batchCreate may succeed for some records and fail for others. Even when the success port fires, inspect the errors array in the output. Records that failed will appear there with the reason.

When to Use

Configuration

Connection

FieldTypeRequiredDescription
ApiTokenstringrequiredScoped Cloudflare API Token with DNS.Edit permission. Store in BizFirst Credentials Manager.

Operation Fields

FieldTypeRequiredDescription
ZoneIdstringrequired32-character hexadecimal Zone ID.
RecordsarrayrequiredArray of record objects. Each must have Type, Name, and Content. Optional: Ttl, Proxied, Priority.

Sample Configuration

{
  "resource": "dns",
  "operation": "batchCreate",
  "connection": {
    "ApiToken": "{{ $credentials.cloudflare_dns_edit }}"
  },
  "ZoneId": "023e105f4ecef8ad9ca31a8372d0c353",
  "Records": [
    { "Type": "A",     "Name": "example.com",       "Content": "198.51.100.4",       "Proxied": true  },
    { "Type": "CNAME", "Name": "www.example.com",    "Content": "example.com",        "Proxied": true  },
    { "Type": "MX",    "Name": "example.com",        "Content": "mail.example.com",   "Priority": 10,  "Proxied": false },
    { "Type": "TXT",   "Name": "example.com",        "Content": "v=spf1 include:_spf.example.com ~all", "Proxied": false }
  ]
}

Validation Errors

CodeConditionResolution
MISSING_API_TOKENApiToken is emptySet the ApiToken credential with DNS.Edit permission
MISSING_ZONE_IDZoneId is emptyProvide the Zone ID
UNKNOWN_ERRORAll records failed or API errorCheck per-record errors array in output for specifics

Output

Success Port

FieldTypeDescription
recordsarrayArray of successfully created record objects (same schema as dns/create output)
errorsarrayArray of per-record errors. Non-empty even on partial success. Each entry has index, code, and message.
successCountintegerNumber of records successfully created
errorCountintegerNumber of records that failed to create

Error Port

Only fires if the entire batch request fails (e.g., auth error). Partial failures are reported in the errors array on the success port.

Sample Output

{
  "records": [
    { "id": "372e67954025e0ba6aaa6d586b9e0b59", "type": "A",     "name": "example.com",    "content": "198.51.100.4", "proxied": true },
    { "id": "9a7806061c88ada191ed06f989cc3dac", "type": "CNAME", "name": "www.example.com", "content": "example.com",  "proxied": true },
    { "id": "f117d94edc2a3d86c4efe6daacbf47f7", "type": "TXT",   "name": "example.com",    "content": "v=spf1 include:_spf.example.com ~all", "proxied": false }
  ],
  "errors": [
    { "index": 2, "code": "81053", "message": "Record already exists." }
  ],
  "successCount": 3,
  "errorCount": 1
}

Expression Reference

ExpressionReturns
{{ $node.BatchCreate.output.records }}Array of successfully created records
{{ $node.BatchCreate.output.successCount }}Number of records created
{{ $node.BatchCreate.output.errorCount }}Number of records that failed
{{ $node.BatchCreate.output.errors }}Per-record error details

Node Policies & GuardRails

PolicyDetail
Always check the errors arrayEven on success port, inspect errorCount — a non-zero value means some records were not created
Require DNS.Edit tokenBatch creation requires write permission
Store ApiToken in Credentials ManagerNever hardcode the token in configuration JSON
Store returned record IDsPersist each returned id in a database or workflow variable for future update/delete operations
Rate limit awarenessEach batchCreate call counts as one API request — be aware of the 1,200 req/5 min limit for very frequent batch operations

Examples

Example 1: New Customer DNS Zone Provisioning

When a new customer is onboarded: Build the Records array dynamically from customer configuration (subdomain, IP, mail server). Call dns/batchCreate. Check errorCount > 0 and alert the provisioning team if any records failed. Store all returned IDs in the customer's infrastructure record.

Example 2: Cross-Zone Record Replication

Use dns/export on the source zone to get a BIND file. Parse the BIND file in a Function node to build the Records array. Call dns/batchCreate on the target zone. Compare successCount against expected count and send a report.

Example 3: Deployment-Time Subdomain Provisioning

At deployment time, read a dns-records.json file from S3 that defines all required subdomains for the release. Pass the array to dns/batchCreate. On completion, feed the records output into a cache/purgeByUrl call for any URLs that changed.