TL;DR: This Wrike Stale Task Escalation Agent uses three chained AI agents to automatically detect stuck tasks, escalate their status, and notify the project manager with an @mention comment . It checks daily for tasks exceeding your defined time-in-status thresholds, helping enforce SLAs and surface bottlenecks without manual monitoring or external tools. Customize the statuses, thresholds, and notifications to fit your workflow, saving managers an estimated 3–5 hours per week.
Hello Community! 👋
We’re thrilled to share a Stale Task Escalation Agent (agent chaining pattern) that automatically detects stale work, escalates it, and notifies the right person, all natively in Wrike using multiple agents that trigger each other ⚙️
Below, you’ll find the complete configuration, prompts, setup instructions, and customization tips so you can adapt this pattern to your own SLA/escalation workflows ✔️
Agent Goal / Use Case
Automatically detect tasks that have been “stuck” too long in certain statuses, escalate them by changing the task status, and notify a project manager with a comment without manual monitoring or external tools.
Typical scenario:
Approvals, reviews, or blocked tasks sit for days (or weeks) before anyone notices. By the time someone realizes, it’s urgent and requires a fire drill.
Example: “Legal reviews can sit for weeks. We need automated escalation when approval time exceeds our SLA.”
This agent chain solves that by:
- Scanning for stuck tasks on a schedule.
- Flagging stale tasks via a custom field.
- Escalating their status automatically.
- Notifying the project manager via comment.
Time Saved: ~3–5 hours/week per manager (no more manual dashboard checks or chasing overdue items)
How It Works
This pattern uses three simple agents chained together:
- Agent 1 (Stale Detector) - Scheduled daily, finds stuck tasks, sets “Stale” field to “Yes”.
- Agent 2 (Escalator) - Triggered by field change, changes status to “Escalated”.
- Agent 3 (Notifier) - Triggered by status change, posts comment @mentioning project manager.
Why three agents?
- Each agent does one thing (detect → escalate → notify).
- Easier to test and debug each step.
- Highly composable: you can swap out detectors, escalation rules, or notification logic independently.
Prerequisites
Before setting up the agents, you’ll need:
Custom Field: “Stale”
- Type: Dropdown (single-select)
- Values: "Yes", "No" (or "Yes" plus blank as default)
- Make sure it’s added and visible in the space/folder/project where the agents will run
Workflow Status: “Escalated” (or similar)
- Add an “Escalated” / “Needs Attention” type status to your task workflow
- This is the status that indicates a task has been formally escalated
Agent Configurations
Agent 1: Stale Detector
This agent runs daily, scans for stuck tasks, and marks them as stale.
Configuration:
Setting | Value |
|---|
Name | Stale Detector |
Agent Scope | Select which tasks, projects, or folders will define this agent’s scope. The agent can watch for triggers and act only on these items and their subitems.
|
Trigger & Action | • Trigger: "Every day at 9:00 AM " • Action: "Change custom field [Stale] to 'Yes" |
Getting Started
- Under Space Settings, click on AI Agents, and select “Or build it yourself here” option.
- You will then see a split view, with the conversational builder on the left and a configuration section on the right. In the configuration section, you can manually add instructions and select the location, trigger, and actions. We will use this section to build the agent.
Select Agent Scope
Add this agent to one or more tasks, projects, or folders so it can do its work. The agent can watch for triggers and act only on these items and their subitems.
Note: Select the Agent Scope as well while building the next two agents.
Prompt (Complete Configuration)
- Paste the below in General instructions section
You are a Stale Task Detector.
Mark tasks as stale when they've been stuck too long.
=== RULES ===
Check tasks in "Pending Approval" status.
If in that status for more than 5 days → mark as stale.
Trigger:
At a Scheduled Time -> Select Days, Time and Zone
Action:
Change Custom Field -> Stale (for example) -> Select Location
Add Instructions:
=== ACTION ===
Set "Stale" field to "Yes".
=== SKIP ===
- Tasks where status changed in last 24 hours
- Tasks already marked Stale = Yes
Agent 2: Escalator
This agent responds when a task is marked stale and changes its status.
Setting | Value |
|---|
Name | Stale Escalator |
Agent Scope | Select which tasks, projects, or folders will define this agent’s scope. The agent can watch for triggers and act only on these items and their subitems. |
Trigger & Action | • Trigger: "When custom field [Stale] changes to 'Yes' in [Scope]..."
• Action: "Change status to 'Escalated'..." |
Prompt (Complete Configuration)
- Paste the below in General instructions section
You are a Stale Task Escalator.
When "Stale" field changes to "Yes" and status is "Pending Approval", change status to "Escalated".
=== SKIP ===
Don't change status if task is already "Completed", "Cancelled", or "Escalated"
Trigger:
When field value changes -> Custom Field -> Stale (for example) -> Select Location
Action:
Change Field Values -> Status -> Select Location
Agent 3: Escalation Notifier
This agent posts a comment when a task is escalated, notifying the project manager.
Setting | Value |
|---|
Name | Escalation Notifier |
Agent Scope | Select which tasks, projects, or folders will define this agent’s scope. The agent can watch for triggers and act only on these items and their subitems. |
Trigger & Action | • Trigger: "When status changes to 'Escalated' in [Scope]..."
• Action: "Post comment in the work item where the trigger happened..." |
Prompt (Complete Configuration)
- Paste the below in General instructions section
You are an Escalation Notifier.
When status changes to "Escalated", post a comment to notify the project manager.
Trigger:
When Field Value Changes -> Status -> “Escalated” -> Select Location
Action:
Post a Comment -> Select if you want to @mention Followers /Assignees or PM -> Select Location
Add Instructions:
=== ACTION ===
Post comment:
"⚠️ This task has been escalated due to extended time in approval. Please review and help unblock."
The Complete Chain
- Agent 1: Stale Detector (Scheduled daily)
Action: Sets "Stale" field to "Yes"
Triggers 👇 - Agent 2: Escalator (Field change trigger)
Action: Changes status to "Escalated"
Triggers 👇 - Agent 3: Notifier (Status change trigger)
Action: Posts comment @mentioning PM
Step-by-Step Setup
Step 1: Create the Custom Field
- Go to Space Settings → Custom Fields → + Custom field.
- Create a new dropdown (Single select) field named “Stale”.
- Add values: “Yes”, “No”. Save.
Step 2: Add Escalation Status (if needed)
- Go to Space Settings → Workflows.
- Edit your task workflow and add status “Escalated” (or similar). Save.
Step 3: Deploy Agent 1 (Stale Detector)
- Go to Space Settings → AI Agents → + Agent/Get Started→ Select “Or build it yourself here” option.
- Set up:
- Name: Stale Detector
- Agent scope: Select the tasks, projects, or folders that define this agent's scope. The agent will monitor triggers and take action only within these items and their subitems.
- Trigger: Scheduled → Daily → 9:00 AM
- Action: "Change custom field [Stale]..."
- Paste the prompts into their respective fields.
- Testing Playground
Toggle the stage selector at the top from "Configure" to "Test" to try sample prompts alongside your form configuration without changing screens.
Step 4: Deploy Agent 2 (Escalator)
- Click "+ Custom AI agent" again.
- Set up:
- Name: Stale Escalator
- Set Scope to the SAME folder/project as Agent 1.
- Trigger: "When custom field [Stale] changes to 'Yes' in [Scope]..."
- Action: "Change status to 'Escalated'..."
- Paste the prompts and test using the Side-by-Side Builder stage toggle.
Step 5: Deploy Agent 3 (Notifier)
- Click "+ Custom AI agent" again.
- Set up:
- Name: Escalation Notifier
- Set Scope to the SAME folder/project as Agents 1 and 2.
- Trigger: "When status changes to 'Escalated' in [Scope]..."
- Action: "Post comment..."
- Paste the prompts (select project manager to @mention ) and test in the playground.
Step 6: Verify the Chain
- Find a task that should be stale (or create a test task).
- Manually set it to “Pending Approval” status with an old date.
- Wait for Agent 1’s scheduled run (or trigger manually in the Test stage view).
- Verify “Stale” field changes to “Yes”.
- Verify Agent 2 triggers and changes status to “Escalated”.
- Verify Agent 3 triggers and posts comment @mentioning project manager .
Customization Examples
- For Approval Workflows:
- Monitor statuses: "Pending Approval" (stale after 5 days), "Legal Review" (stale after 7 days), "Executive Sign-off" (stale after 3 days).
- Escalation status: "Approval Overdue"
- For Creative/Agency Teams:
- Monitor statuses: "Client Review" (stale after 5 days), "Waiting for Assets" (stale after 7 days), "Pending Feedback" (stale after 3 days).
- Escalation status: "At Risk"
- For IT/Support Teams:
- Monitor statuses: "Waiting on Vendor" (stale after 10 days), "Pending Info" (stale after 3 days), "On Hold" (stale after 14 days).
- Escalation status: "Needs Attention"
Expected Results
- Immediate Impact:
- Stuck tasks get flagged automatically.
- No items slip through the cracks.
- Consistent SLA enforcement.
- Team Benefits:
- Managers don’t waste time hunting for overdue items.
- “Escalated” status creates dashboard visibility.
- Clear signal that something needs attention.
- Organizational Benefits:
- Faster resolution of stuck work.
- Data on where bottlenecks occur (which statuses, how often).
- Reduced fire drills from late discovery.
Troubleshooting
- Agent 1 not marking tasks as stale:
- Verify status names match exactly (case-sensitive).
- Check that tasks have been in status long enough.
- Confirm agent can see tasks in the scope (permissions).
- Agent 2 not triggering:
- Verify it’s watching the “Stale” field specifically in its sentence trigger.
- Check that both agents are appointed to the same scope.
- Confirm Agent 1 is actually changing the field (check Activity Dashboard).
- Agent 3 not commenting:
- Verify it’s watching for status change to “Escalated” specifically in its sentence trigger.
- Check that all three agents are appointed to the same scope.
- Confirm Agent 2 is actually changing the status.
- Chain feels slow:
- Agent 2 triggers within seconds of Agent 1’s field change.
- If Agent 1 is scheduled for 9 AM, the full chain completes by 9:01 AM.
- For faster detection, increase Agent 1’s schedule frequency.
- Too many escalations:
- Increase the staleness thresholds.
- Add more exclusions (certain scopes, certain statuses).
- Check that the 24-hour grace period is working.
Found this AI Agent setup guide helpful? Leave a reaction (👍 Like / 🙂 Agree / 💡 Insightful) or share your thoughts in the comments below! 👇