Brief Description:
Struggling to fetch updated user data in Flow after items.update event.
Details:
We’re building a Flow to send a welcome email when a user’s status in directus_users changes to active. The items.update trigger provides the updated user’s ID in keys (“7c544c2d-75ba-4aca-9ece-ba013ee86206”), but the payload only shows admin data ({“last_page”: “/users”}), not the updated user’s status or email.
Our Read Data step uses this filter:
{
"filter": {
"id": { "_eq": "{{ $trigger.keys[0] }}" },
"status": { "_eq": "active" }
},
"fields": ["email", "status", "id"]
}
But it returns the first user with status = active (example0@gmail.com), not the one just updated (example00@gmail.com). We also tried using directus_revisions to check changes but got RangeError: Maximum call stack size exceeded in a Condition step ({{ $read.get_user_data[0].status === ‘active’ }}).
Question:
How can we fetch the updated user’s data in Flow and confirm the status changed to active in this event?
Logs:
{
"event": "users.update",
"payload": { "last_page": "/users" },
"keys": ["7c544c2d-75ba-4aca-9ece-ba013ee86206"],
"collection": "directus_users"
}
{
"query": {
"filter": {
"id": { "_eq": "7c544c2d-75ba-4aca-9ece-ba013ee86206" },
"status": { "_eq": "active" }
},
"fields": ["email", "status", "id"]
},
"collection": "directus_users"
}
[
{ "email": "example0@gmail.com", "status": "active", "id": "7c544c2d-75ba-4aca-9ece-ba013ee86206" }
]
{
"name": "RangeError",
"message": "Maximum call stack size exceeded"
}