Ghost Issue in Dynamics 365 CRM / CE / Dataverse - The Workflow That Was “Inactive”… But Still Executed
You do everything right.
You open Classic Workflow.
You hit Deactivate.
Status shows Draft / Inactive.
Perfect.
You deploy the solution to Test.
You breathe.
Then…
📩 A record updates.
📩
An email gets sent.
📩
A task gets created.
And you just sit there like:
“Wait… who triggered this?”
Because the workflow is inactive.
It should not run.
Yet somehow… it did.
No errors.
No warnings.
Just business logic happening behind your back.
😵 The Usual Developer
Rituals
So naturally you start debugging like a normal human:
✅ Publish all customizations
✅
Refresh browser
✅
Clear cache
✅
Re-import solution
✅
Check the workflow again (inactive, confirmed)
Still… it happens.
At this point, you’re not troubleshooting anymore.
You’re negotiating with the platform.
⭐ The Real Reason (and it’s
annoying)
Here’s the truth:
Dataverse doesn’t “cancel time”.
If the workflow triggered before you deactivated it,
the job may already be sitting inside the system queue.
Meaning:
📌 The workflow is
inactive now
…but the System Job was already created earlier.
So even after deactivation, Dataverse still executes the
queued async job because:
the workflow execution was already scheduled when it was
active.
🧩 Where the Ghost
Actually Lives
Not inside the workflow.
It lives here:
Settings → System Jobs
(or Advanced Settings → System Jobs)
You’ll find entries like:
- Waiting
- In
Progress
- Ready
- Retrying
And those jobs don’t care that you deactivated the workflow.
They already have a mission.
💥 Why This Creates Chaos
in Deployment
This becomes dangerous in real projects because:
- You
deploy a fix to QA
- You
deactivate old automation
- QA
still sees old behavior
- Everyone
assumes deployment failed
- You
re-import multiple times
- Now
you’ve got duplicate logic
And the real culprit?
A queue that was created hours ago.
✅ How to Diagnose It Properly
Next time you see this:
Step 1: Find the workflow
Open the workflow record and check:
➡️ Process Session / System
Jobs
Step 2: Look for jobs created BEFORE deactivation
Check “Created On” timestamps.
If jobs were generated while workflow was active, they’ll
continue running.
🛠️ Fix Options (Realistic
Ones)
✅ Fix 1: Cancel Waiting Jobs
Go to System Jobs and cancel jobs in:
- Waiting
- Ready
- In
Progress (if possible)
This stops the execution chain.
✅ Fix 2: Stop Recurring Triggers
If workflow is triggered by record updates, check if
something else is still updating records and triggering jobs.
Sometimes the workflow isn’t running…
it’s just cleaning up jobs already spawned.
✅ Fix 3: Replace With a New
Workflow (if needed)
If you’re changing logic heavily, it’s often safer to:
- create
new workflow
- activate
new one
- deactivate
old one
- cancel
pending jobs
Because patching an old process can create confusion.
🧠 Architect-Level Lesson
Deactivating a workflow only stops future triggers.
It does not erase the past.
Dataverse is basically saying:
“I won’t create new jobs.
But I will finish what I already started.”
🔥 Best Prevention
Strategy (for real projects)
Before deploying workflow changes to QA/UAT:
✅ Always check System Jobs
✅
Cancel pending jobs for that workflow
✅
Communicate to testers: “Old async jobs may still complete”
✅
Avoid using workflows for logic that must stop instantly
So the next time someone says:
“But the workflow is inactive, it can’t run…”
Just smile.
Because you know the truth:
📌 The workflow isn’t
running. The queue is.
Comments
Post a Comment