Template_Base64-Kodierung

Fortgeschritten

Dies ist ein File Management-Bereich Automatisierungsworkflow mit 9 Nodes. Hauptsächlich werden Set, ConvertToFile, ManualTrigger, ExtractFromFile und andere Nodes verwendet. Konvertieren Sie das JSON-Objekt per Dateiverarbeitung in einen Base64-String

Voraussetzungen
  • Keine besonderen Voraussetzungen, sofort nach Import nutzbar
Workflow-Vorschau
Visualisierung der Node-Verbindungen, mit Zoom und Pan
Workflow exportieren
Kopieren Sie die folgende JSON-Konfiguration und importieren Sie sie in n8n
{
  "name": "Templates_Base64_Encode",
  "nodes": [
    {
      "id": "923f05ea-cd34-4116-8c1d-83a51fe0080c",
      "name": "Notiz",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -580,
        -140
      ],
      "parameters": {
        "color": 7,
        "width": 480,
        "height": 320,
        "content": "## Create Example JSON data\n"
      },
      "typeVersion": 1
    },
    {
      "id": "d1a367bc-f372-40ef-ac8a-abc6326a6b8c",
      "name": "Notiz1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -80,
        -140
      ],
      "parameters": {
        "color": 4,
        "width": 440,
        "height": 320,
        "content": "## Stringify JSON and Save to Binary\n"
      },
      "typeVersion": 1
    },
    {
      "id": "960842f1-5017-415f-80b6-4e21d2c0c51d",
      "name": "Notiz2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        380,
        -140
      ],
      "parameters": {
        "color": 4,
        "width": 360,
        "height": 320,
        "content": "## Convert Binary Data to Base64 Encoded string\n"
      },
      "typeVersion": 1
    },
    {
      "id": "f0b298ab-18f7-414a-ae27-76266830029c",
      "name": "Notiz3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -580,
        -320
      ],
      "parameters": {
        "color": 7,
        "width": 1320,
        "content": "## Encode JSON to Base64 String\nThis example workflow demonstrates how to convert a JSON object into a base64-encoded string using n8n’s built-in file processing capabilities. This is a common requirement when working with APIs, webhooks, or SaaS integrations that expect payloads to be base64-encoded.\n\n**Put the 3 nodes in green into a Sub and make a reusable base64 encoder in your projects.**"
      },
      "typeVersion": 1
    },
    {
      "id": "dd1d4e6b-40ee-4d37-97c0-6bc4d1c9d560",
      "name": "Create Json Data",
      "type": "n8n-nodes-base.set",
      "position": [
        -300,
        -20
      ],
      "parameters": {
        "mode": "raw",
        "options": {},
        "jsonOutput": "{\n  \"string\": \"Hello, world!\",\n  \"number\": 42,\n  \"float\": 3.14,\n  \"booleanTrue\": true,\n  \"booleanFalse\": false,\n  \"nullValue\": null,\n  \"array\": [1, \"two\", false, null],\n  \"nestedObject\": {\n    \"id\": 1,\n    \"name\": \"Nested\",\n    \"attributes\": {\n      \"active\": true,\n      \"tags\": [\"test\", \"sample\"]\n    }\n  },\n  \"arrayOfObjects\": [\n    { \"type\": \"A\", \"value\": 10 },\n    { \"type\": \"B\", \"value\": 20 }\n  ],\n  \"emptyArray\": [],\n  \"emptyObject\": {}\n}\n"
      },
      "typeVersion": 3.4
    },
    {
      "id": "c25f38bf-72a1-4fe3-89b9-dcf0d1d34e30",
      "name": "Manual Execution",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -520,
        -20
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "dcf01114-59d8-4c25-8ee3-5405bed263f2",
      "name": "Convert JSON to String",
      "type": "n8n-nodes-base.set",
      "position": [
        -20,
        -20
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "75e77a08-177d-46dc-bf82-69348bae9e76",
              "name": "json_text",
              "type": "string",
              "value": "={{ JSON.stringify($json) }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "17547a53-ec81-4050-96fe-f1f73542ce85",
      "name": "Extract Base64 from Binary",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        460,
        -20
      ],
      "parameters": {
        "options": {},
        "operation": "binaryToPropery",
        "destinationKey": "base64_text",
        "binaryPropertyName": "encoded_text"
      },
      "typeVersion": 1
    },
    {
      "id": "dd01f82c-2abb-48ff-acbe-0584721225b0",
      "name": "Convert String to Binary",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        180,
        -20
      ],
      "parameters": {
        "options": {
          "encoding": "utf8"
        },
        "operation": "toText",
        "sourceProperty": "json_text",
        "binaryPropertyName": "encoded_text"
      },
      "typeVersion": 1.1
    }
  ],
  "settings": {
    "executionOrder": "v1"
  },
  "connections": {
    "dd1d4e6b-40ee-4d37-97c0-6bc4d1c9d560": {
      "main": [
        [
          {
            "node": "dcf01114-59d8-4c25-8ee3-5405bed263f2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "c25f38bf-72a1-4fe3-89b9-dcf0d1d34e30": {
      "main": [
        [
          {
            "node": "dd1d4e6b-40ee-4d37-97c0-6bc4d1c9d560",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "dcf01114-59d8-4c25-8ee3-5405bed263f2": {
      "main": [
        [
          {
            "node": "dd01f82c-2abb-48ff-acbe-0584721225b0",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "dd01f82c-2abb-48ff-acbe-0584721225b0": {
      "main": [
        [
          {
            "node": "17547a53-ec81-4050-96fe-f1f73542ce85",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "17547a53-ec81-4050-96fe-f1f73542ce85": {
      "main": [
        []
      ]
    }
  }
}
Häufig gestellte Fragen

Wie verwende ich diesen Workflow?

Kopieren Sie den obigen JSON-Code, erstellen Sie einen neuen Workflow in Ihrer n8n-Instanz und wählen Sie "Aus JSON importieren". Fügen Sie die Konfiguration ein und passen Sie die Anmeldedaten nach Bedarf an.

Für welche Szenarien ist dieser Workflow geeignet?

Fortgeschritten - Dateiverwaltung

Ist es kostenpflichtig?

Dieser Workflow ist völlig kostenlos. Beachten Sie jedoch, dass Drittanbieterdienste (wie OpenAI API), die im Workflow verwendet werden, möglicherweise kostenpflichtig sind.

Workflow-Informationen
Schwierigkeitsgrad
Fortgeschritten
Anzahl der Nodes9
Kategorie1
Node-Typen5
Schwierigkeitsbeschreibung

Für erfahrene Benutzer, mittelkomplexe Workflows mit 6-15 Nodes

Externe Links
Auf n8n.io ansehen

Diesen Workflow teilen

Kategorien

Kategorien: 34