UiPath Documentation
maestro-automate
latest
false
Maestro Automate ユーザー ガイド

最初のワークフロー

2 つの API 呼び出し、1 つの意思決定を行う AI エージェント、2 つのブランチを含む受注ワークフローを構築し、テストして、コーディング エージェントを使用するかキャンバスにデプロイします。

このチュートリアルでは、Maestro Automate受注ワークフローを構築します。と説明する。このワークフローでは、新しい注文ごとに在庫と顧客の信用がチェックされ、AI エージェントが注文を受け入れるかどうかを判断してから、注文を作成するか、営業担当者に通知します。

チュートリアルの所要時間は約 15 分です。株式および信用調査では、dummyjson.com無料のサンプル API であるため、アカウントや別のアプリの API キーは必要ありません。最後の 2 つの手順は、顧客関係管理 (CRM) と Slack の代わりとなるスクリプトであるため、ワークフローはこれらのアプリに接続せずに実行されます。上のスクリーンショットは、 Notify sales rep を Slack コネクタとして示しています。これは実際のワークフローにおける動作です。

ワークフローは次の 2 つの方法で構築できます。いずれかを選択すると、ページの残りの部分があなたの選択に従います。

  • コーディング エージェントを使用する場合: ワークフローの説明を入力すると、エージェントが構築します。
  • キャンバス上で手動で: 各ノードを自分で追加および設定します。

開始する前に​

1. ワークフローを構築する​

  1. プロジェクトの空のフォルダーを作成し、VS Code で開きます。

  2. そのフォルダーでコーディング エージェントを起動します。たとえば、Claude Code の場合は、VS Code ターミナルで claude を実行します。

  3. このプロンプトを貼り付けます。

    Create a Maestro Automate project named OrderIntake with a workflow that does exactly this. Don't add, remove, or rename nodes.
    
    1. Rename the Manual trigger to "New order", set its ID to newOrder, and add two input arguments: productId (number) and customerId (string).
    2. Add an HTTP Request node "Check stock" (ID checkStock), GET, with the URL as an expression: "https://dummyjson.com/products/" + $vars.newOrder.output.productId
    3. Add an HTTP Request node "Check credit" (ID checkCredit), GET https://dummyjson.com/users/1
    4. Add an Autonomous Agent node "Review order" (ID reviewOrder) with the default model.
       System prompt: "You review new customer orders. Accept an order only if the product has stock greater than 0 and the customer record is present. Otherwise reject it. Always give a short reason."
       Give the agent the response body of Check stock as the product, and the response body of Check credit as the customer.
       Output variables: accepted (boolean) and reason (string).
    5. Add a Decision node "Accepted?" (ID accepted) with the condition $vars.reviewOrder.output.accepted
    6. On True, add a Script node "Create order in CRM" (ID createOrderInCrm): return { orderCreated: true, productId: $vars.newOrder.output.productId };
    7. On False, add a Script node "Notify sales rep" (ID notifySalesRep): return { notified: true, reason: $vars.reviewOrder.output.reason };
    
    The order is: New order → Check stock → Check credit → Review order → Accepted? → True: Create order in CRM, False: Notify sales rep.
    dummyjson.com is a public sample API, so these URLs work as they are.
    
    Then validate the workflow and fix any problems.
    Create a Maestro Automate project named OrderIntake with a workflow that does exactly this. Don't add, remove, or rename nodes.
    
    1. Rename the Manual trigger to "New order", set its ID to newOrder, and add two input arguments: productId (number) and customerId (string).
    2. Add an HTTP Request node "Check stock" (ID checkStock), GET, with the URL as an expression: "https://dummyjson.com/products/" + $vars.newOrder.output.productId
    3. Add an HTTP Request node "Check credit" (ID checkCredit), GET https://dummyjson.com/users/1
    4. Add an Autonomous Agent node "Review order" (ID reviewOrder) with the default model.
       System prompt: "You review new customer orders. Accept an order only if the product has stock greater than 0 and the customer record is present. Otherwise reject it. Always give a short reason."
       Give the agent the response body of Check stock as the product, and the response body of Check credit as the customer.
       Output variables: accepted (boolean) and reason (string).
    5. Add a Decision node "Accepted?" (ID accepted) with the condition $vars.reviewOrder.output.accepted
    6. On True, add a Script node "Create order in CRM" (ID createOrderInCrm): return { orderCreated: true, productId: $vars.newOrder.output.productId };
    7. On False, add a Script node "Notify sales rep" (ID notifySalesRep): return { notified: true, reason: $vars.reviewOrder.output.reason };
    
    The order is: New order → Check stock → Check credit → Review order → Accepted? → True: Create order in CRM, False: Notify sales rep.
    dummyjson.com is a public sample API, so these URLs work as they are.
    
    Then validate the workflow and fix any problems.
    

    エージェントがプロジェクトを作成し、ノードを追加して、ワークフローを検証します。途中で質問をするかもしれません。プロンプトから回答してください。

  4. エージェントが完了したら、エクスプローラーから .flow ファイルを開きます。フロー キャンバス上で開きます。

  5. 結果を確認する:

    • キャンバスは、このページの上部にあるワークフローと一致します。
    • 警告アイコンを表示したノードがなく、[ 問題] パネルは空です。
    • 下部のツールバーに Maestro Automate が表示されます。[Maestro Orchestrate] と表示されている場合は、それを選択して [Maestro Automate] を選択します。

一致しない場合は、何が違うのかをエージェントに伝えます。たとえば、「小切手のクレジットがありません。[在庫を確認] と [注文確認] の間に追加してください。」

結果: キャンバスがこのページの上部にあるワークフローと一致します。

2. テストする​

テストでは、サンプル データを使用してキャンバス上でワークフローを実行します。

  1. エージェントに「productId が 1 で、customerId が c-100 のワークフローをデバッグしてください」と依頼します。
  2. エージェントがワークフローを実行し、結果を報告します。各ノードが完了し、サンプル製品の在庫があるため、実行は [CRM で注文を作成] への True パスをたどる必要があります。
  3. レポートでエージェントの判断を確認します。「製品の在庫があり、顧客レコードが存在する」などの簡単な理由で、 accepted が trueです。

自分で実行を表示するには、代わりにキャンバスの下部のツールバーで [ デバッグを実行 ] (▶) を選択し、[ キャンバス] タブの [手動 ] の手順を実行します。

3. デプロイして実行する​

これまでのところ、ワークフローはテストとしてのみ実行されています。デプロイすると、キャンバスなしで実行されるライブ ワークフローになります。各実行は、プランの月間実行にカウントされます。

  1. エージェントに依頼します。

    Deploy this workflow, then start one run with productId 1 and customerId c-100, and tell me where I can see the run.
    Deploy this workflow, then start one run with productId 1 and customerId c-100, and tell me where I can see the run.
    

    エージェントがプロジェクトをパッケージ化してデプロイし、それらの入力を使用して実行を開始します。

  2. 実行が終了する時間ができたら、「実行は終了しましたか?最終的な状況と、どの分岐を取ったか教えてください。」

エージェントは、実行が成功し、CRM で順序を作成するための True パスをたどったことを報告します。

結果: ワークフローがデプロイされ、その最初の実行が CRM で順序を作成するための True パスをたどりました。

学習内容​

  • トリガー: すべてのワークフローは 1 つから始まり、入力引数は各実行の開始時に使用するデータを保持します。
  • HTTP 要求: ノードが別のシステムの API を呼び出し、応答を後のノードで利用できるようにします。
  • 式: $vars.<node ID>.output 前のノードの出力を読み取ります。
  • エージェント: エージェントはデータを読み取って決定し、定義した出力変数を返します。
  • 判断: 1 つの条件によって、各実行が 2 つのパスのいずれかに送信されます。
  • テスト: デバッグ実行では、すべてのノードが何を受け取り、何を返したかが表示されます。
  • コーディング エージェント: エージェントは説明から同じワークフローを構築でき、ユーザーはそれをキャンバスで確認します。
  • デプロイ中: デプロイされたワークフローがキャンバスなしで実行され、各実行がステータスとともに一覧表示されます。

次のステップ​

  • 評価: 一連のサンプル注文に対してエージェントの判断を確認します。トレース エントリにある [評価に追加] ボタンを使用すると、素早く開始できます。
  • ワークフローをデプロイする: ユーザーがいなくてもワークフローを実行します。
  • コネクタ: 2 つのスクリプトを実際のアプリに置き換えます。
  • ノードの参照: すべてのノードとその設定方法
  • コミュニティ: 質問したり、他のビルダーとワークフローを共有したりできます。

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

接続

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

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

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

最新情報を取得