This guide covers scheduled text responses. Agents in this flow do not fetch live device data, control devices, send emails, or perform other actions. Direct chat, interrupt, pause/resume of individual tasks, and action approvals are not available in this flow. Include the information the agent needs in the task instructions.
Preparation
You need:- A Firmngin account and the workspace you want to use.
- An available AI model and enough AI budget. Manual tests and scheduled runs use AI budget like a normal chat turn.
- A Cloudflare account with permission to create Workers.
- A computer with a terminal, a text editor, and a version of Node.js and npm supported by Wrangler.
1. Create and test your agent
1
Open Always-On Agent
Select your workspace in Firmngin, open AI Agents → Always-On Agent, and click Create agents.
2
Describe the task
Complete these fields:
Firmngin manages the system instructions and safety rules. Describe your task and provide its context in What to ask on every run; there is no editable system prompt.Click Create agent. You can update the task instructions and project context later through Configure. You can create multiple agents with different names, models, and tasks.
3
Test before scheduling
Close the form and click the play button on the agent card (Run now).Open History, click Refresh if needed, and select the run. Succeeded and an Output show that the response is complete. Use Copy output to copy it.If the status is Queued or Running, keep History open. Active runs and their details update automatically for up to 10 minutes; use Refresh if needed. You can also use Run now while scheduled triggers are disabled for the agent.
4
Create an access token
Open Configure → Access tokens. Enter a New token name, such as
cloudflare-cron, and click Create token.Copy the token immediately and keep it somewhere secure. It is shown only once. You will save it as a Cloudflare secret, not in your code.2. Prepare the Worker
1
Create a working folder
Run these commands in your terminal:Create both files below inside this folder. See Wrangler installation if you need help setting up the tool.
2
Create worker.js
Copy this complete example into This example runs only on a schedule. It does not expose a public address that can trigger an agent run.
worker.js. It reads the agent token from a Cloudflare secret.worker.js
3
Create wrangler.jsonc
In Firmngin, expand How the schedule runs on the Always-On Agent page. Copy the FIRMNGIN_API_URL and AGENT_ID values for your agent.Replace both placeholders below. The API URL must be an HTTPS address that Cloudflare can reach, not Leave
localhost.wrangler.jsonc
crons empty for now so no scheduled run starts before the token is ready. Use one Worker per agent. For another agent, create a separate folder and choose a different Worker name.3. Deploy and save your token
1
Sign in to Cloudflare and deploy
From your Worker folder, run:Complete the browser sign-in and choose the correct Cloudflare account if prompted. This first deployment creates the Worker without an active schedule.
2
Add the token secret
Run:Paste your Firmngin access token when prompted. Keep it out of
vars, source code, screenshots, and repositories. See Cloudflare secrets for more information.3
Enable the schedule
Replace the This runs daily at 01:00 UTC, which is 08:00 WIB (Jakarta). Cloudflare uses UTC, independently of your Firmngin profile timezone.Save the file and deploy again:The schedule becomes active after Cloudflare applies the change. For this guide, manage the schedule in this file and redeploy when you change it.
triggers section in wrangler.jsonc with:Schedule changes can take up to 15 minutes to propagate. Do not rely on execution at an exact second. See Cloudflare Cron Triggers.
4. Verify a scheduled run
1
Make sure the agent is enabled
Enable the agent in Firmngin. Creating an agent alone does not create a schedule: the Worker and schedule from the previous steps must also be deployed.
2
Use a temporary test schedule if needed
To test sooner, replace the daily schedule with
*/5 * * * * and redeploy. This runs every five minutes after the schedule takes effect.Once the test succeeds, replace it with 0 1 * * * and redeploy again. Do not add the test expression as a second schedule. Each run uses AI budget.3
Check the result in Firmngin
After the scheduled time, open the agent’s History and refresh. Find a run with the source Schedule, then open its details.Succeeded together with an Output confirms that the agent finished its task. A successful Worker request only confirms that the request was accepted; check the final result in Firmngin.
Everyday use
- Change the task: update Configure. Task and model changes apply to newly accepted runs without redeploying the Worker. A run that was already accepted keeps its original task and model.
- Disable scheduled runs: disable the agent in Firmngin to reject new scheduled requests. This does not cancel a task that is already running. The Cloudflare schedule still exists; remove it too if you want to stop the trigger. Run now remains available for manual testing.
- Replace a token: create a new token, run
npx wrangler secret put FIRMNGIN_AGENT_TOKENagain, and revoke the old token after the new connection works. - Keep context current: each agent uses its own conversation across runs. Update the task instructions when your project information changes.
- Check scheduling separately: an enabled agent can accept scheduled requests, but that label does not confirm that your Worker is deployed or that its schedule is healthy. Verify a completed run with the source Schedule.