UiPath Documentation
uipath-cli
2026.10
false
UiPath CLI ユーザー ガイド

UIP エージェントのデバッグ

サンプル入力を使用して Studio Web に対してローコード エージェントを実行し、「uip agent debug」で結果をストリーミングします。

uip agent debug runs a low-code agent end-to-end against Studio Web with the inputs you provide, polling until the run finishes and streaming state changes. Requires login. The run starts as you, in your personal workspace, so your user needs a personal robot on the tenant.

プロジェクトでは project.uiproj マニフェストを使用する必要があります。古い project.json レイアウトを使用しているプロジェクトは、変換指示ですぐに失敗します ( uip solution pack/publish などのパッケージ化コマンドは引き続き project.jsonを受け入れます。このような Studio Web にバインドされたコマンドでのみ、新しいマニフェストが必要です)。

概要​

uip agent debug <project-path> [-i <json>] [--attachment <field=path>]... [--poll-interval <ms>] [--timeout <seconds>] [--login-validity <minutes>]
uip agent debug <project-path> [-i <json>] [--attachment <field=path>]... [--poll-interval <ms>] [--timeout <seconds>] [--login-validity <minutes>]

すべての呼び出しは、 グローバル オプション (--output、 --output-filter、 --log-level、 --log-file) に従います。終了コードは 標準契約に従います。

引数​

  • <project-path> (必須) — エージェント プロジェクト ディレクトリへのパスです ( agent.jsonを含む)。

オプション​

フラグ既定 (Default)目的
-i, --inputs <json>{}JSON オブジェクトとしての入力引数 (例:'{"input":"hello"}'です。プレーン オブジェクトとして解析する必要があります。ジョブの添付ファイル フィールドには、既存の Orchestrator の添付ファイル参照 {"ID": "<attachment-id>"}渡すか、 を使用してローカル ファイルをアップロード --attachment 。
--attachment <field=path>—ローカル ファイルを [ジョブの添付ファイル] 入力フィールドにアップロードします agent.json。繰り返し可能。このフィールドは、 inputSchemaで {"$ref": "#/definitions/job-attachment"} として宣言する必要があります。スキーマがジョブ添付ファイルの配列である場合にのみ、同じフィールドを繰り返します。このパスは、エージェント プロジェクト ディレクトリからではなく、現在の作業ディレクトリから解決されます。アップロードされた添付ファイル ID は Data.Attachmentsで返されます。
--poll-interval <ms>2000ポーリング間隔 (ミリ秒)。
--timeout <seconds>600 秒 (10 分)実行が完了するまで待機する最大秒数です。
--login-validity <minutes>10続行するには、トークンの有効期限が切れるまでの最小残り時間 (分) を指定します。
uip agent debug ./my-agent -i '{"input":"hello"}'

uip agent debug ./my-agent --timeout 120 --poll-interval 5000

# Upload a local PDF into the job-attachment input field fileIn
uip agent debug ./my-agent --attachment fileIn=./invoice.pdf -i '{"question":"What is the total?"}'
uip agent debug ./my-agent -i '{"input":"hello"}'

uip agent debug ./my-agent --timeout 120 --poll-interval 5000

# Upload a local PDF into the job-attachment input field fileIn
uip agent debug ./my-agent --attachment fileIn=./invoice.pdf -i '{"question":"What is the total?"}'

--inputsにも存在するフィールドの--attachment値は--inputs値を上書きし、コマンドは警告をログに記録します。必須のジョブの添付ファイルの入力に、 --attachment も --inputs の値も持たない場合、警告が生成されます。

データシェイプ(--output json)​

成功 (Code: "AgentDebug"):

{
  "Code": "AgentDebug",
  "Data": {
    "JobKey": "a1b2c3d4-0000-0000-0000-000000000401",
    "TraceId": "b2c3d4e5-0000-0000-0000-000000000001",
    "State": "Successful",
    "Output": { "content": "hi there" }
  },
  "Instructions": "Debug run completed: Successful"
}
{
  "Code": "AgentDebug",
  "Data": {
    "JobKey": "a1b2c3d4-0000-0000-0000-000000000401",
    "TraceId": "b2c3d4e5-0000-0000-0000-000000000001",
    "State": "Successful",
    "Output": { "content": "hi there" }
  },
  "Instructions": "Debug run completed: Successful"
}

Output は、実行で が生成された場合にのみ存在します。 Info は、サービスが追加の診断情報を返した場合にのみ存在します。

を実行して --attachmentを含むファイルをアップロードすると、 Data.Attachments に各アップロードのリストが表示されます。

{
  "Code": "AgentDebug",
  "Data": {
    "JobKey": "a1b2c3d4-0000-0000-0000-000000000401",
    "TraceId": "b2c3d4e5-0000-0000-0000-000000000001",
    "State": "Successful",
    "Output": { "answer": "1,234.00 USD" },
    "Attachments": [
      {
        "Field": "fileIn",
        "AttachmentId": "c3d4e5f6-0000-0000-0000-000000000002",
        "FileName": "invoice.pdf",
        "MimeType": "application/pdf",
        "Size": 48213
      }
    ]
  }
}
{
  "Code": "AgentDebug",
  "Data": {
    "JobKey": "a1b2c3d4-0000-0000-0000-000000000401",
    "TraceId": "b2c3d4e5-0000-0000-0000-000000000001",
    "State": "Successful",
    "Output": { "answer": "1,234.00 USD" },
    "Attachments": [
      {
        "Field": "fileIn",
        "AttachmentId": "c3d4e5f6-0000-0000-0000-000000000002",
        "FileName": "invoice.pdf",
        "MimeType": "application/pdf",
        "Size": 48213
      }
    ]
  }
}

アップロードしたファイルを再アップロードせずに後から実行で再利用するには、その参照を --inputsで渡します (例: '{"fileIn":{"ID":"c3d4e5f6-0000-0000-0000-000000000002"}}')。

添付ファイルのエラー — 無効な --attachment 値 ( field=path 形式が間違っている、ジョブの添付ファイルの入力ではないフィールド、見つからない、空、またはディレクトリ パス) は、アップロードまたは実行する前に失敗し、 Retry: "RetryWillNotFix"になります。Orchestrator がアップロードを拒否した場合、デバッグ ジョブは開始されません。

非成功の終了ステート — 同じ Code: "AgentDebug"ですが、失敗 (終了コード 1) として返され、実行を検査するために Message: "Debug run <state>." と Instructions が uip traces spans get <TraceId> を指しています。

Invalid file name — a project file whose name holds a control character or any of : * ? " < > | fails the command before anything is uploaded, with ErrorCode: "invalid_argument" and exit code 1. Message names the files. Rename them, or leave them out of the debug bundle with a .uipignore pattern.

No personal robot — when your user has no personal robot on the tenant, Orchestrator refuses to start the job:

{
  "Result": "ConfigError",
  "ErrorCode": "configuration_error",
  "Message": "Your user has no personal robot on this tenant, and 'uip agent debug' runs the agent as you.",
  "Instructions": "Ask a tenant administrator to give your user a personal robot (Orchestrator > Tenant > Manage Access > your user > Robot setup), then run 'uip agent debug' again.",
  "Retry": "RetryWillNotFix",
  "Context": { "HttpStatus": 409, "ErrorCode": "1230", "TraceId": "d4e5f6a7-0000-0000-0000-000000000003" }
}
{
  "Result": "ConfigError",
  "ErrorCode": "configuration_error",
  "Message": "Your user has no personal robot on this tenant, and 'uip agent debug' runs the agent as you.",
  "Instructions": "Ask a tenant administrator to give your user a personal robot (Orchestrator > Tenant > Manage Access > your user > Robot setup), then run 'uip agent debug' again.",
  "Retry": "RetryWillNotFix",
  "Context": { "HttpStatus": 409, "ErrorCode": "1230", "TraceId": "d4e5f6a7-0000-0000-0000-000000000003" }
}

The command exits 1. Any other refusal of the job start keeps the Orchestrator message in Message (Orchestrator refused to start the debug job: …) and is classified by its HTTP status like other service failures: for example, a 401 or 403 returns AuthenticationError and exits 2, and a 400 returns ValidationError and exits 3. No job starts in either case.

非対応のプロジェクト マニフェスト:

{
  "Result": "Failure",
  "ErrorCode": "invalid_argument",
  "Message": "...",
  "Instructions": "Convert the listed project(s) to a project.uiproj manifest before debugging: scaffold the accepted layout with 'uip api-workflow init <name>' inside the solution and move Workflow.json (plus entry-points.json and bindings_v2.json) into it, then remove the project.json-based entry from the .uipx. Note that 'uip solution pack' and 'uip solution publish' accept project.json — only Studio Web-bound commands require project.uiproj."
}
{
  "Result": "Failure",
  "ErrorCode": "invalid_argument",
  "Message": "...",
  "Instructions": "Convert the listed project(s) to a project.uiproj manifest before debugging: scaffold the accepted layout with 'uip api-workflow init <name>' inside the solution and move Workflow.json (plus entry-points.json and bindings_v2.json) into it, then remove the project.json-based entry from the .uipx. Note that 'uip solution pack' and 'uip solution publish' accept project.json — only Studio Web-bound commands require project.uiproj."
}
  • uip agent validate — 最初に実行を実行して、プロジェクトが正しい形式であることを確認します。アップロードに失敗する手順で推奨されます。
  • uip traces spans get — デバッグ実行が失敗ステートになった後にトレースを調べます。

参照​

このページは役に立ちましたか?

接続

ヘルプ リソース サポート(opens in new window)

学習する UiPath アカデミー(opens in new window)

質問する UiPath フォーラム(opens in new window)

最新情報を取得