SAP连接

初级

这是一个Building Blocks领域的自动化工作流,包含 5 个节点。主要使用 Set、HttpRequest、ManualTrigger 等节点。 SAP服务层登录

前置要求
  • 可能需要目标 API 的认证凭证

使用的节点 (5 个)

工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "veR3QmgYzOAMgekz",
  "meta": {
    "instanceId": "06b3271522ae4bedcb94de9dac3219d19e1a4e5fcd0a448a4abc68198b391077"
  },
  "name": "SAP 连接",
  "tags": [],
  "nodes": [
    {
      "id": "34406311-d715-481c-a61c-b8c382536ddb",
      "name": "当点击“执行工作流”时",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        0,
        0
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "72224168-7e1c-437f-816f-9181405d28bb",
      "name": "设置登录数据",
      "type": "n8n-nodes-base.set",
      "position": [
        220,
        0
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "0d7bca14-f15c-4722-b10a-5c10fb763247",
              "name": "sap_url",
              "type": "string",
              "value": ""
            },
            {
              "id": "8edfe1d1-bbbe-487b-bc5d-591ed9faa97d",
              "name": "sap_username",
              "type": "string",
              "value": ""
            },
            {
              "id": "6ff2fb60-0c71-4fab-ae31-26bfcba03058",
              "name": "sap_password",
              "type": "string",
              "value": ""
            },
            {
              "id": "838523c8-1ebb-4bd1-a13b-3f0921f97576",
              "name": "sap_companydb",
              "type": "string",
              "value": ""
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "ef7da537-aaa8-4589-bcc9-80672d0b4096",
      "name": "SAP 连接",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueErrorOutput",
      "position": [
        440,
        0
      ],
      "parameters": {
        "url": "={{ $json.sap_url }}Login",
        "method": "POST",
        "options": {
          "allowUnauthorizedCerts": true
        },
        "jsonBody": "={\n       \"UserName\": \"{{ $json.sap_username }}\",\n       \"Password\": \"{{ $json.sap_password }}\",\n       \"CompanyDB\": \"{{ $json.sap_companydb }}\"\n}",
        "sendBody": true,
        "specifyBody": "json"
      },
      "typeVersion": 4.2
    },
    {
      "id": "960fff2d-1135-4cac-a94a-e174af7b8c3b",
      "name": "失败",
      "type": "n8n-nodes-base.set",
      "position": [
        660,
        100
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "7ed3ddd5-5334-4a53-8f2d-1c883129b6c3",
              "name": "statusCode",
              "type": "string",
              "value": "={{ $json.error.status }}"
            },
            {
              "id": "b5600ed6-ef4b-4b4a-9829-2afc290bd0b3",
              "name": "errorMessage",
              "type": "string",
              "value": "={{ $json.error.message }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "4744fa72-6249-4565-ba17-c225d303c4eb",
      "name": "成功",
      "type": "n8n-nodes-base.set",
      "position": [
        660,
        -100
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "a0be1383-9c5e-4246-b506-7a453c1859f6",
              "name": "sessionID",
              "type": "string",
              "value": "={{ $json.SessionId }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "99dc9b88-369d-4ad1-b42b-f0a7317424ab",
  "connections": {
    "SAP Connection": {
      "main": [
        [
          {
            "node": "Success",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Failed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Login Data": {
      "main": [
        [
          {
            "node": "SAP Connection",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Set Login Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

这是一个初级难度的工作流,适用于Building Blocks等场景。适合 n8n 新手,包含 1-5 个节点的简单工作流

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
初级
节点数量5
分类1
节点类型3
难度说明

适合 n8n 新手,包含 1-5 个节点的简单工作流

外部链接
在 n8n.io 上查看 →

分享此工作流