user/getStatus
Retrieve the current presence status and last activity timestamp for a Slack user. Returns whether the user is active or away based on their recent Slack activity.
When to Use
- Check whether an on-call engineer is active in Slack before routing an urgent page to them.
- Route an incoming customer message to an available agent based on their active/away status.
- Use presence as a soft signal to schedule meeting invites during active periods.
- Pause automated outreach messages while the target user is away.
Approximation Warning: Slack presence status is approximate. Slack marks users as
active when they have recently interacted with the Slack client and away after a period of inactivity. Users may appear away while still working (e.g. in a meeting, focused mode, or using a non-Slack tool). Never use presence as a hard gate for access control. Use it for soft signals only — routing preferences, notification timing, and similar non-critical decisions.Configuration
Connection
| Field | Required | Description |
|---|---|---|
botToken | Required | Slack Bot Token starting with xoxb-. Requires the users:read OAuth scope. |
Operation Fields
| Field | Required | Description |
|---|---|---|
userId | Required | The Slack user ID to retrieve presence for (e.g. U01ABCDEFGH). |
Sample Configuration
{
"operation": "user/getStatus",
"connection": {
"botToken": "{{ $credentials.slackBot.token }}"
},
"userId": "{{ $input.oncallUserId }}"
}
Validation Errors
| Error Code | Cause | Resolution |
|---|---|---|
user_not_found | No user with the given ID exists in the workspace. | Verify the user ID with a user/get call first. |
missing_scope | Token lacks the users:read scope. | Add users:read under OAuth & Permissions in your Slack App and reinstall. |
invalid_auth | Bot token is invalid or revoked. | Regenerate the token and update the credential store. |
Output
Success Port
| Field | Type | Description |
|---|---|---|
userId | string | Slack user ID (echoed from input). |
presenceStatus | string | Current presence — either "active" (recently active in Slack) or "away" (inactive or explicitly set away). |
lastActivity | number | Unix timestamp (seconds) of the user's last recorded Slack activity. May be 0 if no activity has been recorded yet. |
status | string | "success" on successful retrieval. |
errorCode | string | Empty on success. Slack API error code on failure. |
payload | object | Raw Slack API presence response. |
Error Port
Activated when the user is not found or the token lacks the required scope.
Sample Output
{
"userId": "U01ALICE123",
"presenceStatus": "active",
"lastActivity": 1748221180,
"status": "success",
"errorCode": "",
"payload": {
"ok": true,
"presence": "active",
"online": true,
"auto_away": false,
"manual_away": false,
"connection_count": 2,
"last_activity": 1748221180
}
}
Expression Reference
| Expression | Result |
|---|---|
{{ $output.getUserStatus.presenceStatus }} | Presence string — "active" or "away" — for conditional routing. |
{{ $output.getUserStatus.lastActivity }} | Unix timestamp of last activity for staleness checks. |
{{ $output.getUserStatus.userId }} | User ID for downstream nodes. |
{{ $output.getUserStatus.lastActivity | date:'HH:mm' }} | Last activity time formatted as HH:mm for display in messages. |
Node Policies & GuardRails
| Policy Area | Recommendation |
|---|---|
| Soft Signal Only | Presence is approximate and not a reliable real-time signal. Always provide a fallback for away users rather than blocking the workflow entirely (e.g. send to backup contact or queue for later). |
| No Hard Access Control | Never use presence to gate security-sensitive operations. A user appearing away does not mean they are unavailable — they may be in a meeting or on another device. |
| Rate Limits | The users.getPresence endpoint is Tier 3 (50+ req/min). Avoid polling this endpoint in tight loops. Use it as a one-time check at the start of a routing decision. |
| Privacy Awareness | Some workspaces allow users to set their presence to manual away or hide their presence. A "away" response does not distinguish between genuinely inactive and deliberately hidden users. |
| Stale Data | Slack presence can lag by 1–5 minutes. For time-critical routing, combine presence with a schedule check (e.g. Google Calendar or PagerDuty) for higher confidence. |
Examples
Route Page to Active On-Call Engineer
Before sending a critical alert, check if the primary on-call engineer is active. If away, route to the backup.
{
"operation": "user/getStatus",
"userId": "{{ $input.primaryOncallId }}"
}
// If presenceStatus === "active" → send DM to primary
// Else → send DM to backup contact
Delay Outreach Until User is Active
Check presence before sending a non-urgent workflow notification. If away, schedule for the next active period.
{
"operation": "user/getStatus",
"userId": "{{ $input.targetUserId }}"
}
// Branch: presenceStatus === "active" → send now
// Else → enqueue for retry in 30 minutes
Log Last Activity for Idle User Report
In a weekly inactive user report, retrieve last activity for each user and flag those who have been away for over 7 days.
{
"operation": "user/getStatus",
"userId": "{{ $loop.item.userId }}"
}
// Flag condition: ($now - lastActivity) > (7 * 86400)