propeller logo
Examples

Hello World

Hello World WASM example

This is a simple hello world example. The WASM module prints "Hello World!" to stdout. For this example we can use the standard proplet deployment without any additional configuration.

Source Code

The source code is available in the examples/hello-world directory.

Loading...

Create Task

To create a task for this example, we need to build the example to wasm and then create a task with the wasm file.

cd propeller
make hello-world

Your output should look like this:

GOOS=js GOARCH=wasm tinygo build -buildmode=c-shared -o build/hello-world.wasm -target wasi examples/hello-world/hello-world.go

Now we can create a task with the wasm file:

curl -X POST "http://localhost:7070/tasks" \
-H "Content-Type: application/json" \
-d '{"name": "main", "inputs": []}'

Your output should look like this:

{
  "id": "53db63cb-885c-4364-849c-f69640aaa601",
  "name": "main",
  "kind": "standard",
  "state": 0,
  "cli_args": null,
  "inputs": [],
  "daemon": false,
  "encrypted": false,
  "start_time": "0001-01-01T00:00:00Z",
  "finish_time": "0001-01-01T00:00:00Z",
  "created_at": "2026-02-13T10:53:49.157542442Z",
  "updated_at": "0001-01-01T00:00:00Z",
  "next_run": "0001-01-01T00:00:00Z",
  "priority": 50
}

Upload Wasm

Now we need to upload the wasm file:

curl -X PUT "http://localhost:7070/tasks/53db63cb-885c-4364-849c-f69640aaa601/upload" \
-F "file=@$(pwd)/build/hello-world.wasm"

Start Task

Now we can start the task:

curl -X POST "http://localhost:7070/tasks/53db63cb-885c-4364-849c-f69640aaa601/start"

Your output should look like this:

{ "started": true }

The results of the task will be something like this.

curl -X GET "http://localhost:7070/tasks/53db63cb-885c-4364-849c-f69640aaa601"

Your output should look like this:

{
  "id": "53db63cb-885c-4364-849c-f69640aaa601",
  "name": "main",
  "kind": "standard",
  "state": 3,
  "file": "...<redacted>...",
  "cli_args": null,
  "inputs": [],
  "daemon": false,
  "encrypted": false,
  "proplet_id": "a95517f9-5655-4cf5-a7c8-aa00290b3895",
  "results": "Hello World!\n",
  "start_time": "2026-02-13T11:00:43.010348944Z",
  "finish_time": "2026-02-13T11:00:43.202889598Z",
  "created_at": "2026-02-13T10:53:49.157542442Z",
  "updated_at": "2026-02-13T11:00:43.202889537Z",
  "next_run": "0001-01-01T00:00:00Z",
  "priority": 50
}

Invoking Using WasmTime

wasmtime --invoke main ./build/hello-world.wasm

The results of the task will be something like this.

warning: using `--invoke` with a function that takes arguments is experimental and may break in the future
Hello World!

On this page