Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

450
Views
How do I redirect to a studio flow from inside a Twilio Function?

I have a serverless function that is executed when an user sends a message through whatsapp, if the user sends a fixed location, the function get it's latitude and longitude and returns an object on the callback with the location info. I want to make the function run and redirect to a studio flow that is integrated with flex through proxy so I can handle the user's location there and eventually send to a flex agent.

This is the function I have:

exports.handler = function(context, event, callback) {
  console.log("lat: ", event.Latitude);
  console.log("lon: ", event.Longitude);

  if (!event.Latitude || !event.Longitude) {
    callback(null, {
      lat: null,
      lon: null
    });
  } else {
    const location = {
      lat: event.Latitude,
      lon: event.Longitude
    };
    
    callback(null, location);
  }
};

I'm using WhatsApp Sandbox with the above function being called on "when a message comes in". After the function executes I want it to redirect to a Studio Flow (inside the function), is that possible? How can I do it? I'm a beginner dev and new to Twilio.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!