Objective
This article shows you how to add and configure the Run Function widget so your Studio flow executes one of your Twilio Functions and continues based on what it returns.
Product
Studio, Functions and Assets
Environment
Twilio Console
User Account Permission/Role(s) Required
Editing a flow requires the Studio flows create and update permissions on the account.
Procedure
- In the Twilio Console, select Orchestration in the left sidebar.
- Select Studio, then Flows.
- Select the flow you want to edit to open the Editor tab.
- Open the widget library and drag Run Function onto the canvas.
- Select the new widget to open its configuration panel.
- Choose the function to run:
- For a function in a Functions service, choose your Service, then the Environment, then the Function.
- For a function in Functions (Classic), choose that option as the service and then pick the Function URL from the list.
- Alternatively, enter the function's address directly in Function URL.
- To pass data to the function, select Add function parameter, enter the parameter's name as the key and its content as the value, then select Save. Repeat for each parameter.
- Select Save.
- Open the Transitions tab and choose where the flow goes next for If success and If fail.
- Select Publish to make the change live.
Additional Information
- The Environment and Function lists are populated from the service you select, so choose the service first.
- Parameters are passed to your function as request parameters, so name them to match what your function code expects.
- Whatever the function returns is available to later widgets in the flow.
This content was generated by AI and reviewed, edited, and verified by a human.