Using Templates in the Webtask Editor

Use common task templates as a starting point

For customized documentation and ready to run samples, please log in.

Viewing and Using Webtask Templates

Webtask templates allow you to have a quick start to your project, building off of templates that others have created for similar applications.

Webtask Templates

In the templates menu, you can search for existing templates, or click one to create a new task using it. It will give you instructions on how to set up and use the template, and you can then prepopulate the editor with the code for that task. The code can then be edited and modified as required, using the template as a jumping off point for the task.

Proposing a New Template

By clicking the "Propose New Template" link, you will be taken to the GitHub repository where the templates are kept. Here, you can use the YAML model seen in other templates and create your own, and submit a pull request to add it to the listing of templates, if you have a use case that merits it. The best template ideas are scenarios in which the code accomplishes something useful, but also something that could be reused and expanded for other applications.

For more information about the creation process for templates, check the Webtask Templates repository README.

Common Templates

Below is a list of just a few of the more popular templates available:

  • Simple Function - Creates an function with a callback param. Useful tasks that simply return a result.
  • Function with context - Creates a function which includes the context object for accessing data, query, secrets, and more.
  • Full HTTP Control - Creates a function which includes the context, request and response objects in order to allow maximum control.
  • Express - Creates an Express task with a single route.
  • Express with view - Creates an Express task with an embedded view
  • Stripe payment - Sends payments to Stripe.
  • Twilio - Sends an SMS message via Twilio
  • Slack outgoing webhook - Creates a Slack chatbot which receives Slack chat messages and responds in a Slack channel.
  • Sendgrid - Sends an email via Sendgrid