Getting Started

Run code in 30 seconds

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


The recommended way of using webtask is through the wtcommand line interface.

Install the CLI

Once you set it up, here are some common examples of usage.

Create a webtask (from a local file)

The example below creates a webtask based on a local file and returns a URL that can be used to execute it.

$ echo "module.exports = function(cb) { cb(null, 'hello world'); }" > foo.js
$ wt create foo.js          

Specifying the --watch modifier will watch for file changes and refresh the webtask.

Create a webtask (from a public URL)

This example creates a webtask that when called will fetch the code from that public URL and execute it. By default the returned URL causes the webtask code to be read from storage every time the webtask is executed, which is useful when the code changes frequently during development. In order to improve performance once the code is stable, use the --prod modifier to generate a URL that caches the code across executions.

$ wt create --name html-response-url          

Specifying the --name modifier will provide a name for the webtask. The default name is derived from the filename, minus the extension.

Log streaming

Shows the log streaming of all your webtasks. All console.log calls will be available.

$ wt logs          

Create a webtask with a secret

Create a webtask that depends on a secret (a mongodb connection string).

$ wt create --name mongo --secret MONGO_URL=mongodb://

Secrets are encrypted with AES256-CBC. This is a real mongodb URL (powered by mongolab), no guarrantee that it will work :)

Cron a webtask

Cron a webtask that will run every 10 minutes.

$ wt cron schedule -n mongocron -s MONGO_URL=mongodb:// 10m          

Create a webtask that uses express.js

You can use the express framework inside a webtask. Specify --no-parse and --no-merge modifiers to keep the request raw.

$ wt create express.js --no-parse --no-merge          

Get cron history

Get a history of all the runs of a specific cron.

$ wt cron history mongocron          

Get all crons

Get a list of all the crons you have registered.

$ wt cron ls   


Explore more at