Functions

Build faster with serverless Functions

Functions is a serverless environment on Twilio where you can quickly create event-driven microservices, integrate with 3rd party endpoints, and extend Twilio Studio flows with custom logic.

Illustration showing how you can deploy code with Functions through Twilio Serverless.

From concept to first edition in fewer steps

Json code being connected to javascript code that will lead to different functions such as messaging or calls and finally to user

Build event-driven microservices with Node.js

Create scalable, production-grade, event-driven Twilio applications using Node.js. Innovate without worrying about stability. Iterate quickly. Use custom logic for Studio applications and IVR systems.

Integrate with 3rd-party endpoints

Integrate with any 3rd-party system by transforming and filtering your data using the power of Node.js and the npm ecosystem. Make external API requests with ease and set up webhooks to ingest data from Twilio products or external systems.

Node js code connected to a database integrating different 3rth party services.
Studio being connected to Functions that will lead to different actions such as messaging and calls

Your code on Twilio

Bring ideas to life quickly, whether you’re building powerful APIs, complex integrations, or adding custom logic to your IVRs. Let Twilio Functions handle the operational overhead so you can get to market faster.

Automatic scaling and transparent pricing

Serverless on Twilio automatically scales from zero to peak demands and features a pay-as-you-go business model to minimize costs for your organization.

Twilio Code helping grow metrics all around the world

Functions use cases


Deploy with Functions in less than 5 minutes

Send an SMS from a Twilio Phone Number

Send an SMS from a Twilio phone number. With just a few lines of code, you’ll see your phone light up with a Twilio SMS using Twilio Functions.

Send an SMS

Send an SMS from Twilio Functions

exports.handler = async function(context, event, callback) {
  const client = context.getTwilioClient();
  const message = await client.messages.create({
    to: '+15558675310',
    from: '+15017122661',
    body: 'Hi there!'
  });
  callback(null, message.sid);
};

“You don’t have to comment out lines of code to explain what a function is doing. The Twilio code is really clear and easily configured.”

Nate Grieb Product Owner, VictorOps

Try Serverless and Twilio Functions

Get your application up and running with Functions.