Skip to contentSkip to navigationSkip to topbar
Page toolsOn this page
Looking for more inspiration?Visit the

Migrating from Functions (Classic) to the new Functions Editor


(warning)

Auth token update requirements

If you're using Services or Functions (Classic) and have entered your Auth token directly instead of using an environment variable, you must wait for the Auth token to update across all instances. During this time, your Function or Service returns a 403 Forbidden HTTP error.

This guide is for users of Functions (Classic) who want to migrate their existing code to the new Functions Editor. If you're new to Twilio Functions, start with the Functions documentation to learn how to create and manage your serverless applications.


Advantages

advantages page anchor

The updated editor offers several advantages:

  • It runs on infrastructure that is separate from Functions (Classic) and uses the latest V2 APIs.
  • You can access logs live in the Console or later through the Logs endpoint. In Functions (Classic), logs were available only while you viewed them in the Console UI.
  • Improved reliability and a refined user interface.
  • Better organization of your Twilio applications through the use of Services.

Migrate functions from Functions (Classic) to the new editor

migrate-functions-from-functions-classic-to-the-new-editor page anchor
  1. Go to the Twilio Console and navigate to Develop > Functions & Assets > Services.
  2. Create a Service.
  3. Copy the code from the existing Functions (Classic) function.
  4. In the Functions Editor, choose Add + and create a function with the same name in the service you just created.
  5. Paste the code from Functions (Classic) into the new function, and then select Save.
  6. Configure any required dependencies for the service.
  7. Configure any required environment variables for the service.
  8. Select Deploy All to deploy the service, its functions, and any assets.
  9. If any phone numbers still reference the original Functions (Classic) function, update them to reference the new function or functions you created.
(information)

Organize your functions with Services

If you have multiple Twilio applications, create a separate Service for each application. Group the functions that belong to a specific application under the corresponding Service.

(warning)

Assets (Classic) are not compatible with the new Functions Editor

Assets (Classic) and the new Functions Editor are not compatible. Re-upload any Assets (Classic) as Assets before you use them in the new editor.