How to use "Go to action" in the MS Bot Composer?

604 Views Asked by At

Trying to manage a conversation flow by "Go to action" action (sorry for tautology). All tests to call all types of actions by ID from *.dialog return error.

ClassName:"System.ArgumentException"
Message:"GotoAction: could not find an action of "cW0raQ"."

How reference looks

I didn't find any mention in the documentation how to work with this action, therefore it must be pretty simple, but I can't catch the correct way.

1

There are 1 best solutions below

1
On

As usually, answer myself.
Had a look at MS tests in their repo https://github.com/microsoft/botbuilder-dotnet/ and found out that it requires creating ID for action manually. Automatic $designer.id doesn't work.

{
  "$kind": "Microsoft.GotoAction",
  "$designer": {
    "id": "uFOn5P"
  },
  "actionId": "targetID"
},
...
{
  "id": "targetID",
  "$kind": "Microsoft.SendActivity",
  "$designer": {
    "id": "oWxpDh",
    "comment": "",
    "name": "GoTo test"
  },
  "activity": "${SendActivity_oWxpDh()}"
}

Moreover, this action works in scope of trigger only, not dialog.