Create a page that match with given figma design AEM local instance using n8n ai agent workflow | Community
Skip to main content
Level 2
November 8, 2025

Create a page that match with given figma design AEM local instance using n8n ai agent workflow

  • November 8, 2025
  • 5 replies
  • 658 views

Wjen i was trying to create n8n workflow for the task it always fails as forbidden credentials or 403

5 replies

ManviSharma
Adobe Employee
Adobe Employee
November 8, 2025

Hello @mohamedvalith ,

As the request is failing with a 403 Forbidden error, which indicates that the API is rejecting the credentials or blocking the request from n8n.

To proceed, could you please confirm the following so we can narrow down the issue:

  1. Are the correct API credentials/scopes enabled for this request?

  2. Has the n8n server IP been allow-listed on your side (if required by your firewall/WAF)?

  3. Are there any restrictions on the HTTP method or endpoint being called?

Once we have this information, we can validate the setup and help resolve the issue quickly.

Level 2
November 8, 2025

thanks for your response, it is not even gone to the figma call. it is getting failed in the connection establishment to AEM local instance node itself.

 

i am try to achieve it using my n8n local setup. and i was removed all figma related nodes and try to run workflow to establish connection to AEM local and create a page. but that also getting failed. 

 

workflow json:

{
"name": "Create AEM Page with RAW Body and Cookies",
"nodes": [
{
"parameters": {},
"id": "33168164-e8f6-4364-9b1c-9963abb8bea7",
"name": "Manual Trigger",
"type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1,
"position": [
128,
352
]
},
{
"parameters": {
"authentication": "genericCredentialType",
"genericAuthType": "httpBasicAuth",
"url": "https://ac27b425062f.ngrok-free.app/libs/granite/csrf/token.json",
"options": {}
},
"id": "e4419cd6-d308-4b4c-9eb8-0987e20aa959",
"name": "Fetch CSRF Token",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 2,
"position": [
480,
496
]
},
{
"parameters": {
"authentication": "genericCredentialType",
"genericAuthType": "httpBasicAuth",
"url": "https://ac27b425062f.ngrok-free.app/content/etisalat/language-master/en/c/demo/ai-pages/",
"responseFormat": "string",
"options": {},
"headerParametersUi": {
"parameter": [
{
"name": "Content-Type",
"value": "multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW"
},
{
"name": "CSRF-Token",
"value": "={{$json[\"token\"]}}"
}
]
}
},
"id": "c77c7936-8f4b-4021-9ef0-c5fb06bc69d2",
"name": "Create AEM Page",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 2,
"position": [
672,
496
]
}
],
"pinData": {},
"connections": {
"Manual Trigger": {
"main": [
[
{
"node": "Fetch CSRF Token",
"type": "main",
"index": 0
}
]
]
},
"Fetch CSRF Token": {
"main": [
[
{
"node": "Create AEM Page",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "dc5be432-f477-46c6-9ef1-43e981963ba6",
"meta": {
"instanceId": "b97237cc69f620ea38279603a37a4dd77020f20940bc140c02e848442ce68a0b"
},
"id": "n9Pj58b3kPlxcoRV",
"tags": []
}

Tanika02
Level 7
February 26, 2026

Hi ​@mohamedvalith  - 

  1. Have you tried using docker rather?
  1. I have added few tweaks to your workflow JSON ; Added ngrok-skip-browser-warning header; Changed authentication from genericCredentialType to manual Authorization header

Please check; 

{
"name": "Create AEM Page",
"nodes": [
{
"parameters": {},
"id": "33168164-e8f6-4364-9b1c-9963abb8bea7",
"name": "Manual Trigger",
"type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1,
"position": [128, 352]
},
{
"parameters": {
"method": "GET",
"url": "https://ac27b425062f.ngrok-free.app/libs/granite/csrf/token.json",
"authentication": "none",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "ngrok-skip-browser-warning",
"value": "true"
},
{
"name": "Authorization",
"value": "Basic YWRtaW46YWRtaW4="
}
]
},
"options": {}
},
"id": "e4419cd6-d308-4b4c-9eb8-0987e20aa959",
"name": "Fetch CSRF Token",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.1,
"position": [340, 352]
},
{
"parameters": {
"method": "POST",
"url": "https://ac27b425062f.ngrok-free.app/content/etisalat/language-master/en/c/demo/ai-pages/my-test-page",
"authentication": "none",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "ngrok-skip-browser-warning",
"value": "true"
},
{
"name": "Authorization",
"value": "Basic YWRtaW46YWRtaW4="
},
{
"name": "CSRF-Token",
"value": "={{ $json.token }}"
}
]
},
"sendBody": true,
"contentType": "multipart-form-data",
"bodyParameters": {
"parameters": [
{
"name": "jcr:primaryType",
"value": "cq:Page"
},
{
"name": "jcr:content/jcr:primaryType",
"value": "cq:PageContent"
},
{
"name": "jcr:content/jcr:title",
"value": "My New AI Page"
},
{
"name": "jcr:content/sling:resourceType",
"value": "etisalat/components/page"
},
{
"name": "jcr:content/cq:template",
"value": "/conf/etisalat/settings/wcm/templates/page-template"
}
]
},
"options": {}
},
"id": "c77c7936-8f4b-4021-9ef0-c5fb06bc69d2",
"name": "Create AEM Page",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.1,
"position": [552, 352]
}
],
"pinData": {},
"connections": {
"Manual Trigger": {
"main": [
[
{
"node": "Fetch CSRF Token",
"type": "main",
"index": 0
}
]
]
},
"Fetch CSRF Token": {
"main": [
[
{
"node": "Create AEM Page",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "dc5be432-f477-46c6-9ef1-43e981963ba6",
"meta": {
"instanceId": "b97237cc69f620ea38279603a37a4dd77020f20940bc140c02e848442ce68a0b"
},
"id": "n9Pj58b3kPlxcoRV",
"tags": []
}

 

BrianKasingli
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
November 8, 2025

When using n8n to connect to your local AEM instance (AEMaaCS SDK) and automate tasks like creating pages, a 403 Forbidden error usually means authentication is missing or incorrect.

Recommended for Local Testing:

  1. Use Basic Authentication
    AEM (especially the local SDK) expects a Basic Auth header for tools like n8n.
    You can log in with your AEM credentials (e.g., admin:admin) and generate the Authorization header in Base64 format.

    Follow this guide to get the correct header:
    How to Get Authorization Basic Auth Header from AEM -  https://sourcedcode.com/blog/aem/how-to-get-authorization-basic-auth-header-from-aem-author 

  2. Make Sure the POST Call is Correct
    Since n8n acts as an HTTP client, it’s important your POST request matches AEM’s expectations (headers, content type, and CSRF handling if needed).

    This tutorial explains how to make proper POST requests to AEM using an HTTP client:
    How to Make Simple HTTP POST Methods in AEM with an HTTP REST Client - https://sourcedcode.com/blog/video-tutorial/how-to-make-simple-http-post-methods-in-aem-with-a-http-rest-client 
Level 2
November 8, 2025

thanks for your reply. i am tried your suggessions. basic authontication was getting proper responce. instead of using postman i am try to trigger it from terminal using below.

 

curl -u admin:admin \

  -F"jcr:primaryType=cq:Page" \

  -F"jcr:content/jcr:primaryType=cq:PageContent" \

  -F"jcr:content/jcr:title=My New Page" \

  -F"jcr:content/sling:resourceType=myapp/components/page" \

  -F"jcr:content/cq:template=/conf/myapp/settings/wcm/templates/page-template" \

  http://localhost:4502/content/mysite/my-new-page


above command work find in terminal. and creates new page as per given conffiguration. but while create a n8n node for the same it getting failed. 

 

foollowing is the error log:

{
"errorMessage": "Forbidden - perhaps check your credentials?",
"errorDetails": {
"rawErrorMessage": [
"403 - \"\\n\""
],
"httpCode": "403"
},
"n8nDetails": {
"nodeName": "Create AEM Page",
"nodeType": "n8n-nodes-base.httpRequest",
"nodeVersion": 1,
"itemIndex": 0,
"time": "11/8/2025, 11:28:27 PM",
"n8nVersion": "1.118.2 (Cloud)",
"binaryDataMode": "filesystem",
"stackTrace": [
"NodeApiError: Forbidden - perhaps check your credentials?",
" at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base_@aws-sdk+credential-providers@3.808.0_asn1.js@5_afd197edb2c1f848eae21a96a97fab23/node_modules/n8n-nodes-base/nodes/HttpRequest/V1/HttpRequestV1.node.ts:1032:12)",
" at processTicksAndRejections (node:internal/process/task_queues:105:5)",
" at WorkflowExecute.executeNode (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@opentelemetry+api@1.9.0_@opentelemetry+sdk-trace-base@1.30_08b575bec2313d5d8a4cc75358971443/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1093:8)",
" at WorkflowExecute.runNode (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@opentelemetry+api@1.9.0_@opentelemetry+sdk-trace-base@1.30_08b575bec2313d5d8a4cc75358971443/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1274:11)",
" at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@opentelemetry+api@1.9.0_@opentelemetry+sdk-trace-base@1.30_08b575bec2313d5d8a4cc75358971443/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1708:27",
" at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@opentelemetry+api@1.9.0_@opentelemetry+sdk-trace-base@1.30_08b575bec2313d5d8a4cc75358971443/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:2324:11"
]
}
}

BrianKasingli
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
November 9, 2025

Try looking at your AEM error logs, it may give you additional information. The following error log looks like its coming from your n8n application.

kautuk_sahni
Community Manager
Community Manager
February 23, 2026

@mohamedvalith Quick follow-up! Were you able to resolve this issue? If so, it would be great if you could share what worked for you so others can benefit. Also, if any of the replies helped—whether they fully solved it or just guided you in the right direction—please consider marking one as accepted. It really helps future community members find solutions faster. Closing the loop makes a big difference!

Kautuk Sahni
Level 2
March 13, 2026

Dear ​@kautuk_sahni ,

Unfortunately i couldn’t make it

Level 2
February 26, 2026

Hi ​@mohamedvalith  - Nice to meet you! I built something similar in December myself. :)

 

I see you’re trying to connect it to your local AEM environment. This may be the wrong question, but is it a 6.X environment? Because if it is, you’ll need an ngrok tunnel to connect a local to n8n.

 

I could be totally off, though, so let me know what you find out!

AmitVishwakarma
Community Advisor
Community Advisor
February 26, 2026

Hi ​@mohamedvalith ,
Your curl works, so the only task is to make n8n send the exact same request (plus any ngrok quirks) to AEM.
Below is a minimal workflow JSON that does work against a local AEM 6.x exposed via ngrok:

  • Uses Authorization header (Basic) instead of n8n’s generic auth
  • Adds ngrok-skip-browser-warning header
  • Fetches CSRF token then POSTs multipart/form-data to create the page

Adjust only:

  • Host: your ngrok
  • URL Path: your site path + page name
  • Template + resourceType to your project values
{
"name": "Create AEM Page via n8n",
"nodes": [
{
"parameters": {},
"id": "manual-trigger",
"name": "Manual Trigger",
"type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1,
"position": [200, 300]
},
{
"parameters": {
"method": "GET",
"url": "https://YOUR-NGROK-ID.ngrok-free.app/libs/granite/csrf/token.json",
"authentication": "none",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "ngrok-skip-browser-warning",
"value": "true"
},
{
"name": "Authorization",
"value": "Basic YWRtaW46YWRtaW4="
}
]
}
},
"id": "fetch-token",
"name": "Fetch CSRF Token",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.1,
"position": [450, 300]
},
{
"parameters": {
"method": "POST",
"url": "https://YOUR-NGROK-ID.ngrok-free.app/content/mysite/my-new-page",
"authentication": "none",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "ngrok-skip-browser-warning",
"value": "true"
},
{
"name": "Authorization",
"value": "Basic YWRtaW46YWRtaW4="
},
{
"name": "CSRF-Token",
"value": "={{ $json.token }}"
}
]
},
"sendBody": true,
"contentType": "multipart-form-data",
"bodyParameters": {
"parameters": [
{
"name": "jcr:primaryType",
"value": "cq:Page"
},
{
"name": "jcr:content/jcr:primaryType",
"value": "cq:PageContent"
},
{
"name": "jcr:content/jcr:title",
"value": "My New Page"
},
{
"name": "jcr:content/sling:resourceType",
"value": "myapp/components/page"
},
{
"name": "jcr:content/cq:template",
"value": "/conf/myapp/settings/wcm/templates/page-template"
}
]
}
},
"id": "create-page",
"name": "Create AEM Page",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.1,
"position": [700, 300]
}
],
"connections": {
"Manual Trigger": {
"main": [[{ "node": "Fetch CSRF Token", "type": "main", "index": 0 }]]
},
"Fetch CSRF Token": {
"main": [[{ "node": "Create AEM Page", "type": "main", "index": 0 }]]
}
}
}

Checklist:

  • n8n Cloud vs Local
    • n8n Cloud cannot call http://localhost:4502 → you must use ngrok or another tunnel.
    • n8n Local (Docker/desktop) can talk directly to http://host.docker.internal:4502 or http://localhost:4502.

Thanks,
Amit

Amit Vishwakarma - Adobe Commerce Champion 2025 | 16x Adobe certified | 4x Adobe SME