Docs/tools/developers/curl to n8n

cURL to n8n Converter

Transform cURL commands into n8n HTTP Request node configurations for workflow automation

cURL to n8n Converter

Convert cURL commands into ready-to-import n8n HTTP Request nodes - instantly, with no AI required.

Access: /tools/developers/curl-to-n8n


Overview

cURL to n8n parses your cURL commands and generates n8n HTTP Request node configurations that you can directly import into your workflows. This is a pure client-side tool with no AI.

Key features:

  • n8n v4.1 compatible - Latest HTTP Request node format
  • Complete configuration - Headers, body, authentication
  • Clipboard-ready JSON - Paste directly into n8n
  • Multiple output modes - Node only or full workflow
  • Instant conversion - No API calls, works offline

How to Use

  1. Paste cURL - Enter your cURL command
  2. Click Convert - Get n8n node configuration
  3. Copy JSON - One-click copy to clipboard
  4. Import in n8n - Paste into your workflow canvas

Importing into n8n

  1. Open your n8n workflow
  2. Click anywhere on the canvas
  3. Press Ctrl+V (or Cmd+V on Mac)
  4. Node appears with full configuration

Example Input

curl -X POST 'https://api.slack.com/api/chat.postMessage' \
  -H 'Authorization: Bearer xoxb-your-bot-token' \
  -H 'Content-Type: application/json' \
  -d '{
    "channel": "C0123456789",
    "text": "Hello from n8n!",
    "blocks": [
      {
        "type": "section",
        "text": {"type": "mrkdwn", "text": "*New notification*"}
      }
    ]
  }'

Example Output

n8n Node Configuration

{
  "parameters": {
    "method": "POST",
    "url": "https://api.slack.com/api/chat.postMessage",
    "authentication": "genericCredentialType",
    "genericAuthType": "httpHeaderAuth",
    "sendHeaders": true,
    "headerParameters": {
      "parameters": [
        {
          "name": "Authorization",
          "value": "Bearer xoxb-your-bot-token"
        },
        {
          "name": "Content-Type",
          "value": "application/json"
        }
      ]
    },
    "sendBody": true,
    "specifyBody": "json",
    "jsonBody": "{\n  \"channel\": \"C0123456789\",\n  \"text\": \"Hello from n8n!\",\n  \"blocks\": [\n    {\n      \"type\": \"section\",\n      \"text\": {\"type\": \"mrkdwn\", \"text\": \"*New notification*\"}\n    }\n  ]\n}",
    "options": {}
  },
  "type": "n8n-nodes-base.httpRequest",
  "typeVersion": 4.1,
  "position": [0, 0],
  "id": "generated-node-id",
  "name": "HTTP Request"
}

Output Modes

Node Only (Default)

Single HTTP Request node configuration - paste directly into canvas.

Full Workflow

Complete workflow JSON including:

  • Manual Trigger node
  • HTTP Request node
  • Node connections
  • Workflow metadata
{
  "meta": {
    "instanceId": "generated"
  },
  "nodes": [
    {
      "parameters": {},
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [0, 0],
      "id": "manual-trigger-id",
      "name": "Manual Trigger"
    },
    {
      "parameters": { /* HTTP Request config */ },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.1,
      "position": [220, 0],
      "id": "http-request-id",
      "name": "HTTP Request"
    }
  ],
  "connections": {
    "Manual Trigger": {
      "main": [[{ "node": "HTTP Request", "type": "main", "index": 0 }]]
    }
  }
}

cURL to n8n Mapping

cURL Optionn8n FieldNotes
URLurlFull URL with query params
-X methodmethodGET, POST, PUT, DELETE, etc.
-H headersheaderParametersArray of name/value pairs
-d JSON bodyjsonBodyWhen Content-Type is JSON
-d form bodybodyParametersParsed as key-value pairs
-u user:passBasic Auth credentialsMaps to credential type
-F multipartbodyParametersForm data mode
Query paramsExtracted from URLShown in queryParameters

Authentication Mapping

Bearer Token

curl -H 'Authorization: Bearer token123' ...
{
  "authentication": "genericCredentialType",
  "genericAuthType": "httpHeaderAuth",
  "headerParameters": {
    "parameters": [
      { "name": "Authorization", "value": "Bearer token123" }
    ]
  }
}

Basic Auth

curl -u username:password ...
{
  "authentication": "genericCredentialType",
  "genericAuthType": "httpBasicAuth"
}

Note: Create n8n credentials separately and reference them.

API Key

curl -H 'X-API-Key: your-api-key' ...
{
  "headerParameters": {
    "parameters": [
      { "name": "X-API-Key", "value": "your-api-key" }
    ]
  }
}

Body Type Handling

JSON Body

curl -H 'Content-Type: application/json' -d '{"key": "value"}' ...
{
  "sendBody": true,
  "specifyBody": "json",
  "jsonBody": "{\"key\": \"value\"}"
}

Form Data

curl -d 'username=john&password=secret' ...
{
  "sendBody": true,
  "specifyBody": "keypair",
  "bodyParameters": {
    "parameters": [
      { "name": "username", "value": "john" },
      { "name": "password", "value": "secret" }
    ]
  }
}

Multipart Form

curl -F 'file=@document.pdf' -F 'name=My Doc' ...
{
  "sendBody": true,
  "contentType": "multipart-form-data",
  "bodyParameters": {
    "parameters": [
      { "name": "file", "value": "={{ $binary.file }}" },
      { "name": "name", "value": "My Doc" }
    ]
  }
}

Using n8n Expressions

After importing, replace hardcoded values with n8n expressions:

Reference Previous Node Data

{
  "jsonBody": "{{ JSON.stringify($json) }}"
}

Use Workflow Variables

{
  "url": "https://api.example.com/users/{{ $json.userId }}"
}

Environment Variables

{
  "headerParameters": {
    "parameters": [
      { "name": "Authorization", "value": "Bearer {{ $env.API_TOKEN }}" }
    ]
  }
}

Technical Details

SpecificationValue
AI ModelNone (custom parser)
ProcessingClient-side JavaScript
n8n VersionHTTP Request v4.1
OutputValid n8n JSON
ExportCopy to clipboard

Common Use Cases

API Integration Workflows

Quickly add API calls to your n8n automations:

  1. Find cURL example in API docs
  2. Convert to n8n node
  3. Import and connect to trigger

Webhook Response Actions

Convert webhook handling cURL examples:

# From Stripe docs
curl https://api.stripe.com/v1/payment_intents \
  -u sk_test_xxx: \
  -d amount=2000 \
  -d currency=gbp

Migration from Scripts

Convert bash scripts with cURL to n8n workflows:

# Before: bash script
curl -X POST https://slack.com/api/chat.postMessage ...

# After: n8n workflow node

Testing APIs

Rapidly prototype API integrations in n8n environment.


Tips for Best Results

  1. Include all headers - Copy complete cURL with auth
  2. Use single quotes - Prevents shell interpolation issues
  3. Valid JSON - Ensure body is properly formatted
  4. Replace secrets - Use n8n credentials/variables after import
  5. Test before production - Verify in n8n before activating workflow

Limitations

  • File uploads - Binary files need manual n8n binary handling
  • OAuth flows - Use n8n's built-in OAuth credentials instead
  • Complex auth - AWS Signature, OAuth2 flows need native n8n support
  • Response parsing - Add Set node for response processing

Privacy & Security

  • 100% client-side - No data sent to servers
  • No storage - cURL commands not persisted
  • No tracking - Input not logged
  • Works offline - No internet required after page load

Security note: Replace sensitive tokens with n8n credentials or environment variables after importing. Don't commit credentials to version control.