POST
/
embed
/
api
/
workflows
/
{workflowName}
/
run
公开入口运行 workflow
curl --request POST \
  --url https://wfapi.yuhe.space/embed/api/workflows/{workflowName}/run \
  --header 'Content-Type: application/json' \
  --header 'x-workflow-embed-token: <api-key>' \
  --data '
{
  "token": "wfembed_xxx",
  "inputs": {
    "message": "hello"
  },
  "conversation_id": "browser-thread",
  "user": "visitor-1",
  "toolPermissionPolicies": {
    "search": {
      "enabled": true,
      "autoApprove": false
    }
  }
}
'
{
  "errCode": 123,
  "errMessage": "<string>",
  "data": {
    "runId": "<string>",
    "createdAt": "2023-11-07T05:31:56Z",
    "target": "<string>",
    "resolvedTarget": "<string>",
    "args": [
      "<string>"
    ],
    "durationMs": 123,
    "stdout": "<string>",
    "stderr": "<string>",
    "exitCode": 123,
    "report": {},
    "conversationId": "<string>",
    "external": {
      "principalKind": "<string>",
      "actorType": "<string>",
      "actorUserId": "<string>",
      "actorProfileId": "<string>",
      "actorDisplayName": "<string>",
      "apiKeyId": "<string>",
      "apiKeyName": "<string>",
      "user": "<string>",
      "conversationId": "<string>",
      "inputs": {},
      "files": [
        "<unknown>"
      ],
      "webhook": {
        "workflowName": "<string>",
        "requestId": "<string>",
        "target": "<string>",
        "resolvedTarget": "<string>",
        "headers": {}
      }
    },
    "debugNode": "<string>",
    "pendingUserInput": {
      "requestId": "<string>",
      "nodeName": "<string>",
      "title": "<string>",
      "params": [
        {}
      ],
      "createdAt": "2023-11-07T05:31:56Z",
      "description": "<string>",
      "defaultValues": {},
      "metadata": {}
    },
    "resolvedUserInputs": [
      {
        "requestId": "<string>",
        "nodeName": "<string>",
        "values": {},
        "submittedAt": "2023-11-07T05:31:56Z"
      }
    ]
  }
}

Authorizations

x-workflow-embed-token
string
header
required

Embed token;也可通过 query/body 的 token 传入。

Path Parameters

workflowName
string
required

Body

application/json
token
string
required
inputs
object
args
string[]
conversation_id
string
user
string
toolPermissionPolicies
object
Example:
{
"search": { "enabled": true, "autoApprove": false }
}

Response

200 - application/json

Embed run 结果,包在统一 ApiResponse 中。

errCode
integer
required
errMessage
string
required
Allowed value: ""
data
object
required