Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Your first task

In this tutorial you create a small JavaScript task, let a Node.js agent execute it, and confirm that it completed.

1. Create the task

  1. Open http://localhost:3000/addtask.html and log in if prompted.
  2. Under Script Source, select Manual.
  3. Set Task Type to Other (specify) and enter node.
  4. Enter a task name, for example Hello from SheetBot.
  5. Paste this script:
console.log("Hello from SheetBot");
  1. Leave Status set to Awaiting.
  2. Click Add Task and note the task ID.

2. Start the agent

In a terminal with your credentials exported:

export SHEETBOT_BASEURL=http://localhost:3000
export SHEETBOT_AUTH_USER=your_username
export SHEETBOT_AUTH_PASS=your_password

curl -fsSL "$SHEETBOT_BASEURL/scripts/agent.js" | node

The agent requests a task of type node, accepts it, runs the script, and reports completion. The script’s console.log output appears in the agent terminal. Because the agent polls once and exits, start it after creating the task, or run it in a loop.

3. Check the result

Open the task in the web UI. Its status should change from AWAITING to RUNNING and then COMPLETED.

Next