trigger.advanced-tasks

trigger.advanced-tasks is a cursor rule for Cursor from agentset-ai/agentset. It costs 3,202 tokens per session, scanned A, original, MIT.

Rules for advanced Trigger.dev v4 tasks, which are background jobs that can run asynchronously and for a long time. They cover features such as tags, batches, queues, retries, and task relationships.

In plain words
What is it for?
Use them to tag and subscribe to task runs, trigger batches, organize related jobs, and apply advanced patterns for long-running or dependent tasks.
Why use it?
They help structure and track larger workloads without relying only on individual task IDs. Tags and batching make it easier to group runs and submit many items for processing.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use them to tag and subscribe to task runs, trigger batches, organize related jobs, and apply advanced patterns for long-running or dependent tasks.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/agentset-ai/agentset/trigger.advanced-tasks
About the project

Agentset is an open-source platform for building retrieval-augmented generation applications, which let AI systems find relevant information from document collections before generating responses. Developers use it for ingestion, vector search, evaluation, cited chat, hosting, and agentic applications through APIs and SDKs. Its catalogue rules and skills provide agent guidance for working with Agentset.

agentset-ai/agentset · 2,112 stars · on GitHub · agentset.ai

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/agentset-ai/agentset

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for trigger.advanced-tasks

README.md
[![agentmods](https://agentmods.dev/badge/rules/agentset-ai/agentset/trigger.advanced-tasks/github.svg)](https://agentmods.dev/rules/agentset-ai/agentset/trigger.advanced-tasks)
Your own site
<a href="https://agentmods.dev/rules/agentset-ai/agentset/trigger.advanced-tasks"><img src="https://agentmods.dev/badge/rules/agentset-ai/agentset/trigger.advanced-tasks/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for trigger.advanced-tasks

Your own site · 80×15
<a href="https://agentmods.dev/rules/agentset-ai/agentset/trigger.advanced-tasks"><img src="https://agentmods.dev/badge/rules/agentset-ai/agentset/trigger.advanced-tasks.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 3,202 This file is loaded in full into every session.
When invoked 3,202 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.03202 $0.03202
Opus 5.5 $0.01281 $0.01281
Sonnet 5.5 $0.00640 $0.00640
Haiku 4.5 $0.00320 $0.00320

Measured 1mo ago against content hash 16d5dccf4131, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

trigger.advanced-tasks scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

packages/jobs/.cursor/rules/trigger.advanced-tasks.mdc · 491 lines

How it starts

The opening of the file, as written. The whole thing — 491 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Trigger.dev Advanced Tasks (v4)

Advanced patterns and features for writing tasks

Tags & Organization

import { task, tags } from "@trigger.dev/sdk";

export const processUser = task({
  id: "process-user",
  run: async (payload: { userId: string; orgId: string }, { ctx }) => {
    // Add tags during execution
    await tags.add(`user_${payload.userId}`);
    await tags.add(`org_${payload.orgId}`);

    return { processed: true };
  },
});

// Trigger with tags
await processUser.trigger(
  { userId: "123", orgId: "abc" },
  { tags: ["priority", "user_123", "org_abc"] } // Max 10 tags per run
);

// Subscribe to tagged runs
for await (const run of runs.subscribeToRunsWithTag("user_123")) {
  console.log(`User task ${run.id}: ${run.status}`);
}

Tag Best Practices:

  • Use prefixes: user_123, org_abc, video:456
  • Max 10 tags per run, 1-64 characters each
  • Tags don't propagate to child tasks automatically

Batch Triggering v2

Enhanced batch triggering with larger payloads and streaming ingestion.

Limits

  • Maximum batch size: 1,000 items (increased from 500)
  • Payload per item: 3MB each (increased from 1MB combined)
  • Payloads > 512KB automatically offload to object storage

Rate Limiting (per environment)

Tier Bucket Size Refill Rate
Free 1,200 runs 100 runs/10 sec
Hobby 5,000 runs 500 runs/5 sec
Pro 5,000 runs 500 runs/5 sec

Concurrent Batch Processing

Tier Concurrent Batches
Free 1
Hobby 10
Pro 10

Usage

import { myTask } from "./trigger/myTask";

// Basic batch trigger (up to 1,000 items)
const runs = await myTask.batchTrigger([
  { payload: { userId: "user-1" } },
  { payload: { userId: "user-2" } },
  { payload: { userId: "user-3" } },
]);

// Batch trigger with wait
const results = await myTask.batchTriggerAndWait([
  { payload: { userId: "user-1" } },
  { payload: { userId: "user-2" } },
]);

for (const result of results) {
  if (result.ok) {
    console.log("Result:", result.output);
  }
}

// With per-item options
const batchHandle = await myTask.batchTrigger([
  {
    payload: { userId: "123" },
    options: {
      idempotencyKey: "user-123-batch",
      tags: ["priority"],
    },
  },
  {
    payload: { userId: "456" },
    options: {
      idempotencyKey: "user-456-batch",
    },
  },
]);

Read the full file on GitHub · 491 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 491 lines · 3,202 tokens per session scan A 16d5dccf4131

Subscribe to this mod's changes

trigger.advanced-tasks is a cursor rule published in the GitHub repository agentset-ai/agentset (2,112 stars, last pushed today), licensed MIT. It adds 3,202 tokens to every session, about $0.0128 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.