ロボットからデータを受け取り、Chuck Norris APIに問い合わせ、その値をロボットに返すというロジックがここにある。
ワークフローロジック
Workflow In
ノードをワークスペースにドラッグします。


Workflow In の
プロパティで、OpenFlow ワークフローが割り当てるキューを定義するために、キュー 名を
設定します。キュー名は完全に任意であり、ユーザが好きな名前を選択できます。この例では、chuckapi
と設定しています。
備考
Node-RED ワークスペース内のノードのプロパティにアクセスするには、指定されたノードをダブルクリックします。ノードのプロパティボックスが表示され、それ自体に必要な各入力フィールドが表示されます。
RPA
チェックボックスをオンにすると、このフローのワークフローがOpenRPAエージェントから呼び出されるようになります。
Name
入力フィールドにワークフローの名前を設定します。ここでは、ChuckAPIと
設定しています。


HTTP Request
ノードをワークスペースにドラッグします。

Workflow In」
ノードと「HTTP Request
」ノードを接続します。


備考
ノードの接続は、Ctrl
キーを押しながら、各ノードの外側にあるポートという灰色の長方形をクリックするだけで簡単にできます。クリックしたままでも接続できますが、筆者はCtrl
キーを使う方が使いやすいと感じています。
リクエストのMethodを
GETに
設定します。
リクエストの送信先となるAPIのURLを
設定します。この例では、https://api.chucknorris.io/jokes/random?category={{category}}
です。
Mustache(https://mustache.github.io/mustache.5.html) の中の変数、すなわちcategory
も同様に任意の名前になっています。
この変数は、OpenRPAがユーザーから取得した選択肢の値を渡すために使用されます。ユーザーは自分の好きなように名前をつけることができます。
返送
するタイプを設定します。この例では、パースされた JSON オブジェクトが
返されます。

Workflow Out
ノードをワークスペースにドラッグします。

HTTP Request
ノードとWorkflow Out
ノードを接続します。


備考
ノードの接続は、Ctrl
キーを押しながら、各ノードの外側にあるポートという灰色の長方形をクリックするだけで簡単にできます。クリックしたままでも接続できますが、筆者はCtrl
キーを使う方が使いやすいと思います。
画面左上の赤い「Deploy」ボタンをクリックして、フローをデプロイします。
