first commit
Security: Sync from Public / sync-from-public (push) Has been cancelled
Test: Benchmark Nightly / build (push) Has been cancelled
Test: Benchmark Nightly / Notify Cats on failure (push) Has been cancelled
CI: Python / Checks (push) Has been cancelled
Test: Evals Python / Workflow Comparison Python (push) Has been cancelled
Util: Check Docs URLs / check-docs-urls (push) Has been cancelled
Test: Visual Storybook / Cloudflare Pages (push) Has been cancelled
Test: E2E Performance / build-and-test-performance (push) Has been cancelled
Test: Workflows Nightly / Run Workflow Tests (push) Has been cancelled
Util: Cleanup CI Docker Images / Delete stale CI images (push) Has been cancelled
Test: Benchmark Destroy Env / build (push) Has been cancelled
Util: Update Node Popularity / update-popularity (push) Has been cancelled
Test: E2E Coverage Weekly / Coverage Tests (push) Has been cancelled

This commit is contained in:
2026-03-17 16:22:57 +03:30
commit 3d5eaf9445
15349 changed files with 2847338 additions and 0 deletions
@@ -0,0 +1,18 @@
{
"node": "n8n-nodes-base.cloudflare",
"nodeVersion": "1.0",
"codexVersion": "1.0",
"categories": ["Development"],
"resources": {
"credentialDocumentation": [
{
"url": "https://docs.n8n.io/integrations/builtin/credentials/cloudflare/"
}
],
"primaryDocumentation": [
{
"url": "https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.cloudflare/"
}
]
}
}
@@ -0,0 +1,181 @@
import type {
IExecuteFunctions,
IDataObject,
ILoadOptionsFunctions,
INodeExecutionData,
INodePropertyOptions,
INodeType,
INodeTypeDescription,
} from 'n8n-workflow';
import { NodeConnectionTypes } from 'n8n-workflow';
import { cloudflareApiRequest, cloudflareApiRequestAllItems } from './GenericFunctions';
import { zoneCertificateFields, zoneCertificateOperations } from './ZoneCertificateDescription';
export class Cloudflare implements INodeType {
description: INodeTypeDescription = {
displayName: 'Cloudflare',
name: 'cloudflare',
icon: 'file:cloudflare.svg',
group: ['input'],
version: 1,
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
description: 'Consume Cloudflare API',
defaults: {
name: 'Cloudflare',
},
usableAsTool: true,
inputs: [NodeConnectionTypes.Main],
outputs: [NodeConnectionTypes.Main],
credentials: [
{
name: 'cloudflareApi',
required: true,
},
],
properties: [
{
displayName: 'Resource',
name: 'resource',
type: 'options',
noDataExpression: true,
options: [
{
name: 'Zone Certificate',
value: 'zoneCertificate',
},
],
default: 'zoneCertificate',
},
...zoneCertificateOperations,
...zoneCertificateFields,
],
};
methods = {
loadOptions: {
async getZones(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
const returnData: INodePropertyOptions[] = [];
const { result: zones } = await cloudflareApiRequest.call(this, 'GET', '/zones');
for (const zone of zones) {
returnData.push({
name: zone.name,
value: zone.id,
});
}
return returnData;
},
},
};
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
const items = this.getInputData();
const returnData: IDataObject[] = [];
const length = items.length;
const qs: IDataObject = {};
let responseData;
const resource = this.getNodeParameter('resource', 0);
const operation = this.getNodeParameter('operation', 0);
for (let i = 0; i < length; i++) {
try {
if (resource === 'zoneCertificate') {
//https://api.cloudflare.com/#zone-level-authenticated-origin-pulls-delete-certificate
if (operation === 'delete') {
const zoneId = this.getNodeParameter('zoneId', i) as string;
const certificateId = this.getNodeParameter('certificateId', i) as string;
responseData = await cloudflareApiRequest.call(
this,
'DELETE',
`/zones/${zoneId}/origin_tls_client_auth/${certificateId}`,
{},
);
responseData = responseData.result;
}
//https://api.cloudflare.com/#zone-level-authenticated-origin-pulls-get-certificate-details
if (operation === 'get') {
const zoneId = this.getNodeParameter('zoneId', i) as string;
const certificateId = this.getNodeParameter('certificateId', i) as string;
responseData = await cloudflareApiRequest.call(
this,
'GET',
`/zones/${zoneId}/origin_tls_client_auth/${certificateId}`,
{},
);
responseData = responseData.result;
}
//https://api.cloudflare.com/#zone-level-authenticated-origin-pulls-list-certificates
if (operation === 'getMany') {
const zoneId = this.getNodeParameter('zoneId', i) as string;
const returnAll = this.getNodeParameter('returnAll', i);
const filters = this.getNodeParameter('filters', i, {});
Object.assign(qs, filters);
if (returnAll) {
responseData = await cloudflareApiRequestAllItems.call(
this,
'result',
'GET',
`/zones/${zoneId}/origin_tls_client_auth`,
{},
qs,
);
} else {
const limit = this.getNodeParameter('limit', i);
Object.assign(qs, { per_page: limit });
responseData = await cloudflareApiRequest.call(
this,
'GET',
`/zones/${zoneId}/origin_tls_client_auth`,
{},
qs,
);
responseData = responseData.result;
}
}
//https://api.cloudflare.com/#zone-level-authenticated-origin-pulls-upload-certificate
if (operation === 'upload') {
const zoneId = this.getNodeParameter('zoneId', i) as string;
const certificate = this.getNodeParameter('certificate', i) as string;
const privateKey = this.getNodeParameter('privateKey', i) as string;
const body: IDataObject = {
certificate,
private_key: privateKey,
};
responseData = await cloudflareApiRequest.call(
this,
'POST',
`/zones/${zoneId}/origin_tls_client_auth`,
body,
qs,
);
responseData = responseData.result;
}
}
returnData.push(
...this.helpers.constructExecutionMetaData(
this.helpers.returnJsonArray(responseData as IDataObject[]),
{
itemData: { item: i },
},
),
);
} catch (error) {
if (this.continueOnFail()) {
returnData.push({ json: { error: error.message } });
continue;
}
throw error;
}
}
return [returnData as INodeExecutionData[]];
}
}
@@ -0,0 +1,61 @@
import type {
IDataObject,
IExecuteFunctions,
IHttpRequestMethods,
ILoadOptionsFunctions,
IPollFunctions,
IRequestOptions,
JsonObject,
} from 'n8n-workflow';
import { NodeApiError } from 'n8n-workflow';
export async function cloudflareApiRequest(
this: IExecuteFunctions | ILoadOptionsFunctions | IPollFunctions,
method: IHttpRequestMethods,
resource: string,
body = {},
qs: IDataObject = {},
_uri?: string,
headers: IDataObject = {},
): Promise<any> {
const options: IRequestOptions = {
method,
body,
qs,
uri: `https://api.cloudflare.com/client/v4${resource}`,
json: true,
};
try {
if (Object.keys(headers).length !== 0) {
options.headers = Object.assign({}, options.headers, headers);
}
if (Object.keys(body).length === 0) {
delete options.body;
}
return await this.helpers.requestWithAuthentication.call(this, 'cloudflareApi', options);
} catch (error) {
throw new NodeApiError(this.getNode(), error as JsonObject);
}
}
export async function cloudflareApiRequestAllItems(
this: IExecuteFunctions | ILoadOptionsFunctions,
propertyName: string,
method: IHttpRequestMethods,
endpoint: string,
body: IDataObject = {},
query: IDataObject = {},
): Promise<any> {
const returnData: IDataObject[] = [];
let responseData;
query.page = 1;
do {
responseData = await cloudflareApiRequest.call(this, method, endpoint, body, query);
query.page++;
returnData.push.apply(returnData, responseData[propertyName] as IDataObject[]);
} while (responseData.result_info.total_pages !== responseData.result_info.page);
return returnData;
}
@@ -0,0 +1,183 @@
import type { INodeProperties } from 'n8n-workflow';
export const zoneCertificateOperations: INodeProperties[] = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
displayOptions: {
show: {
resource: ['zoneCertificate'],
},
},
options: [
{
name: 'Delete',
value: 'delete',
description: 'Delete a certificate',
action: 'Delete a certificate',
},
{
name: 'Get',
value: 'get',
description: 'Get a certificate',
action: 'Get a certificate',
},
{
name: 'Get Many',
value: 'getMany',
description: 'Get many certificates',
action: 'Get many certificates',
},
{
name: 'Upload',
value: 'upload',
description: 'Upload a certificate',
action: 'Upload a certificate',
},
],
default: 'upload',
},
];
export const zoneCertificateFields: INodeProperties[] = [
/* -------------------------------------------------------------------------- */
/* certificate:upload */
/* -------------------------------------------------------------------------- */
{
displayName: 'Zone Name or ID',
name: 'zoneId',
type: 'options',
description:
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
typeOptions: {
loadOptionsMethod: 'getZones',
},
required: true,
displayOptions: {
show: {
resource: ['zoneCertificate'],
operation: ['upload', 'getMany', 'get', 'delete'],
},
},
default: '',
},
{
displayName: 'Certificate Content',
name: 'certificate',
type: 'string',
required: true,
displayOptions: {
show: {
resource: ['zoneCertificate'],
operation: ['upload'],
},
},
default: '',
description: "The zone's leaf certificate",
},
{
displayName: 'Private Key',
name: 'privateKey',
type: 'string',
required: true,
displayOptions: {
show: {
resource: ['zoneCertificate'],
operation: ['upload'],
},
},
default: '',
},
/* -------------------------------------------------------------------------- */
/* certificate:getMany */
/* -------------------------------------------------------------------------- */
{
displayName: 'Return All',
name: 'returnAll',
type: 'boolean',
description: 'Whether to return all results or only up to a given limit',
default: false,
displayOptions: {
show: {
resource: ['zoneCertificate'],
operation: ['getMany'],
},
},
},
{
displayName: 'Limit',
name: 'limit',
type: 'number',
default: 25,
typeOptions: {
minValue: 1,
maxValue: 50,
},
displayOptions: {
show: {
resource: ['zoneCertificate'],
operation: ['getMany'],
returnAll: [false],
},
},
description: 'Max number of results to return',
},
{
displayName: 'Filters',
name: 'filters',
type: 'collection',
placeholder: 'Add Field',
default: {},
displayOptions: {
show: {
resource: ['zoneCertificate'],
operation: ['getMany'],
},
},
options: [
{
displayName: 'Status',
name: 'status',
type: 'options',
options: [
{
name: 'Active',
value: 'active',
},
{
name: 'Expired',
value: 'expired',
},
{
name: 'Deleted',
value: 'deleted',
},
{
name: 'Pending',
value: 'pending',
},
],
default: '',
description: "Status of the zone's custom SSL",
},
],
},
/* -------------------------------------------------------------------------- */
/* certificate:get */
/* -------------------------------------------------------------------------- */
{
displayName: 'Certificate ID',
name: 'certificateId',
type: 'string',
required: true,
displayOptions: {
show: {
resource: ['zoneCertificate'],
operation: ['get', 'delete'],
},
},
default: '',
},
];
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="1024" height="1024"><circle cx="512" cy="512" r="512" style="fill:#f38020"/><path d="M608.2 592.4c3.1-10.8 1.9-20.7-3.3-28.1-4.8-6.7-12.9-10.6-22.6-11.1l-184.7-2.4c-1.1 0-2.2-.6-2.8-1.5s-.7-2.1-.4-3.3c.6-1.8 2.4-3.2 4.3-3.3l186.4-2.4c22.1-1 46.1-18.9 54.5-40.8l10.6-27.8q.75-1.8.3-3.6c-12-54.3-60.5-94.8-118.4-94.8-53.4 0-98.7 34.5-114.9 82.4-10.5-7.8-23.9-12-38.3-10.6-25.7 2.5-46.2 23.1-48.8 48.8-.6 6.6-.1 13.1 1.4 19.1-41.9 1.2-75.3 35.4-75.3 77.6 0 3.7.3 7.5.8 11.2.3 1.8 1.8 3.1 3.6 3.1h340.9c1.9 0 3.8-1.4 4.3-3.3zM667 473.7c-1.6 0-3.4 0-5.1.2-1.2 0-2.2.9-2.7 2.1l-7.2 25c-3.1 10.8-2 20.7 3.3 28.1 4.8 6.7 12.9 10.6 22.7 11.1l39.3 2.4c1.2 0 2.3.6 2.8 1.5.6.9.7 2.3.5 3.3-.6 1.8-2.4 3.2-4.4 3.3l-41 2.4c-22.2 1-46 18.9-54.5 40.8l-3 7.6c-.6 1.5.5 3 2.1 3h140.8c1.6 0 3.1-1 3.6-2.7 2.4-8.7 3.7-17.9 3.7-27.3 0-55.5-45.3-100.8-101-100.8" style="fill:#fff"/></svg>

After

Width:  |  Height:  |  Size: 913 B