0

I'm trying to understand how to get Flow SID in a callback function.

  1. I created a small server with a flask (python).
  2. Also, I assigned ngrok URL of my server in setting the phone to "CALL STATUS CHANGES".
  3. And I start studio flow where I set one variable.
  4. I can debug every moment when I finished the call through the studio flow. In other words, the webhook works properly.

But I don't know how to catch Flow SID after the call was finished.

  1. I tried getting information from call (client.calls(request.get('CallSid')).fetch()), but nothing interesting: CAXXXXXXXXXXXXXXXXXX. I don't know how to use the call ID to get Flow ID.
  2. I put the static param in the URL of the hook (&flow_sid=4444). It seems to work, but I did not find the way how to put dynamic SID from the flow studio in params of the web-hook.

Could you help me get variable from studio flow to a callback function of the python server? Probably there is another simple way how to transfer data from studio flow to the callback function.

2 Answers2

1

I added 1234566fsddf.ngrok.io/after_call?flow_sid={{flow.sid}} to the widget "Make HTTP request" in Flow Studio (thanks @Alan) and it works!

0

The Flow SID/Execution SID are exposed in the Trigger Widget.

{{flow.sid}}

{{flow.flow_sid}}

Alan
  • 10,465
  • 2
  • 8
  • 9
  • Thanks for the answer! I added to the URl, but it doesn't work and web-hook did not go to debug mode: https://1234566fsddf.ngrok.io/after_call?flow_sid={{flow.sid}} – titoalehandro May 04 '21 at 21:16
  • You need to use it inside Studio, the statusBack URL for a Twilio phone number doesn’t have access to it. The statusCallBack for a voice Studio Flow needs to point to that Studio Flow so you don’t run into stuck executions, https://support.twilio.com/hc/en-us/articles/360019383714-Understanding-and-Avoiding-Stuck-Executions-in-Twilio-Studio. – Alan May 04 '21 at 21:40