Jobs Module

Background task scheduling with cron, periodic, and continuous execution modes

Overview

The Jobs module provides background task execution capabilities for NarraNexus agents. It supports three execution modes -- cron-based scheduling, periodic intervals, and continuous processing -- allowing agents to perform work asynchronously outside of direct user interactions. Jobs are organized using directed acyclic graphs (DAGs) for complex multi-step workflows.

Execution Modes

Cron jobs run on a fixed schedule defined by a cron expression. These are suitable for recurring tasks like daily summaries, weekly reports, or periodic data synchronization.

Periodic jobs run at regular intervals (e.g., every 5 minutes). They are useful for polling external services, monitoring conditions, or performing incremental processing.

Continuous jobs run indefinitely, processing items from a queue or stream. They are designed for event-driven workloads where the agent needs to respond to incoming data in near-real-time.

DAG Workflows

For complex tasks that involve multiple dependent steps, the Jobs module supports DAG-based workflows. Each node in the DAG represents a task, and edges define dependencies. The scheduler ensures that tasks execute only after their dependencies have completed, enabling parallel execution where the dependency graph allows.

MCP Tools

The LLM can create and manage jobs through MCP tools. jobs_schedule creates a new job with the specified execution mode and parameters. jobs_status checks the state of running or completed jobs. jobs_cancel terminates a running job. These tools allow agents to autonomously schedule follow-up work during conversations.

NarraNexus - Multi-Agent Framework