thinkkeyspeak
thinkkeyspeak

Reputation: 11

Can a Twilio Studio widget run a function created under another account?

I have a studio flow set up under a Subaccount. I have a function created under the main account.

When I create a function widget in the subaccount studio flow, I don’t see the main account’s function listed.

I’ve also tried using the http request widget calling the function’s url, but studio shows an error saying that the url cannot be blank.

So is it possible to run a function under a different account with the Twilio Studio function widget?

Upvotes: 0

Views: 280

Answers (1)

philnash
philnash

Reputation: 73027

Subaccounts are normally used to separate resources from each other. So a Twilio Function written in one account will not appear in another.

You could use the HTTP request widget to make a request to the Function by its URL, however that would only work if your Function is set to public visibility.

I’ve also tried using the http request widget calling the function’s url, but studio shows an error saying that the url cannot be blank.

If you've entered the URL of the function into the widget, the Studio HTTP request widget should be fine. If you are finding it is showing an error, something else might be wrong.


I would not recommend running cross account resources like this though. It breaks the separation of concerns that a subaccount gives you.

Instead, I would deploy the function code to your subaccount as well, and then hook it up as normal in the Studio Flow. That way, you always know that only work done within the Subaccount can affect its behaviour.

Upvotes: 0

Related Questions