Skip to content

Conversation

@himanshu7895
Copy link
Contributor

Generates a structured approval matrix by traversing a user’s managerial chain for the specified number of levels (e.g., their manager, manager’s manager, etc.).
This avoids hardcoding approval paths — making approvals dynamic and maintainable.

⚙️ Inputs
Name Type Description
user_sys_id String Sys ID of the starting user
levels Integer Number of manager levels to retrieve (e.g., 3 = manager → director → VP)

🧾 Output
Name Type Description
approval_matrix JSON Array of { level, approver_sys_id, approver_name, approver_email }

Scenario:
A flow runs when an “Expense Request” is submitted.
Instead of assigning approvals manually, this Flow Action:

Takes the requester’s Sys ID.

Retrieves their manager hierarchy up to 3 levels.

Dynamically generates approvals (e.g., Manager → Department Head → Director).

Flow setup example:

Trigger: New Expense Request submitted.

Action: Generate Approval Matrix (input: current.user.sys_id, levels = 3).

Loop: For each approver in matrix → Create approval record.

Result: Fully dynamic, hierarchy-based approval flow.

🧩 Key Benefits

🔁 No hardcoding — adapts to real org chart changes.

🧱 Reusable across multiple approval workflows.

🧮 Supports configurable depth (1–N levels).

🧼 Self-contained — no external tables or integrations.

@github-actions
Copy link

Valid PR for ActionPack

Thank you for your contribution. This PR complies with the CONTRIBUTING.md.
A maintainer will review this shortly. In the meantime, Happy Hacking!

…finition_74773827c368721051c35ffdd4013164.xml
@ravichandra1998g ravichandra1998g self-assigned this Oct 20, 2025
@himanshu7895 himanshu7895 marked this pull request as ready for review October 20, 2025 08:18
@github-actions
Copy link

Valid PR for ActionPack

Thank you for your contribution. This PR complies with the CONTRIBUTING.md.
A maintainer will review this shortly. In the meantime, Happy Hacking!

@ravichandra1998g
Copy link
Contributor

Hello @himanshu7895

The action doesn't contain an error evaluation step to handle if there's any error.

Please add the error step and resubmit.
Closing this for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants