logo

setWorkflowAction β€” Navigate a User Between Screens

Moves one user from the screen they are on to another screen in a component workflow.
πŸ’‘ There is no acknowledgement. The server forwards the instruction straight to the user's client, so a successful call is silent.

Request

method is "setWorkflowAction".
Field
Type
Required
Description
user_id
String
Yes
The user to move.
screen_id
String
Yes
The screen they are on now.
reference
String
Yes
Your id for this request. The server rejects the call without it.
next_screen
String
Optional
The screen to move them to.
vapp_id
String
Optional
The virtual app the workflow belongs to.
app_id
String
Optional
The app the component belongs to.

Preconditions

Requirement
Why
Caller must be a bot
The server ignores the request from any other sender type.
Screens must already exist
Components are designed in the nandbox App Builder and cannot be created over the API.

Response

None. Nothing comes back to the bot.
What you will see instead is the user's next interaction on the new screen, arriving as a menuCallback.

SDKs

The argument order differs between SDKs β€” check the signature you are calling.
SDK
Call
Java
api.setWorkflowAction(userId, vappId, screenId, nextScreen, reference, appId);
JavaScript
api.setWorkflowAction(userId, screenId, nextScreen, vappId, reference, appId);
Python
napi.set_workflow_action(user_id, vapp_id, screen_id, next_screen, reference, app_id)

Example

Request

json
{ "method": "setWorkflowAction", "user_id": "90089584793718478", "screen_id": "uV1kyCyvseaar5j", "next_screen": "kL9pQrTvw3XmZa8", "vapp_id": "90090684341943480", "app_id": "90090684293000559", "reference": "123452342" }
java
api.setWorkflowAction( "90089584793718478", "90090684341943480", "uV1kyCyvseaar5j", "kL9pQrTvw3XmZa8", "123452342", "90090684293000559");
javascript
api.setWorkflowAction( "90089584793718478", "uV1kyCyvseaar5j", "kL9pQrTvw3XmZa8", "90090684341943480", "123452342", "90090684293000559" );
python
napi.set_workflow_action( user_id="90089584793718478", vapp_id="90090684341943480", screen_id="uV1kyCyvseaar5j", next_screen="kL9pQrTvw3XmZa8", reference="123452342", app_id="90090684293000559", )