Having a small trouble with BambooHR to Entra ID

I’m creating workflows for integration of BambooHR with Entra ID.

So i had to divide my workflows, on 3 seperate workflows. I’ve created “create user” workflow, “update user” workflow and “delete user” workflow, also i set 3 webhooks in BambooHR because it doesn’t have events, just call them by status (active or inactive) and thats it.

Now i can check for update how to add “reporting to” into Entra ID node and in “create user” workflow how to add them into groups.
I have a problem with “reporting to” or “manager” in Entra ID node, it doesn’t exist.
Also, in “Create user” workflow (the one bellow) im trying to add them to groups but it says that distribution groups or security groups. So if you have any ideas?

Information on your n8n setup

  • **n8n version:1.80.3
  • **Database (default: SQLite):
  • **n8n EXECUTIONS_PROCESS setting (default: own, main):
  • **Running n8n via (Docker, npm, n8n cloud, desktop app):
  • **Operating system:

Hi @Todor
I think your ‘Reporting To’ and ‘Manager’ attributes are custom user attributes because I don’t see them in the default user attribute list.

It looks like the Entra ID node lists just the default ones.

This part of the Microsoft article documentation says that they are accessible through the Microsoft Graph API so if the default Entra Id node doesn’t have them maybe you’ll be able to get them with an custom HTTP Request. :expressionless: :cry:

2 Likes

Oh, well. I’ve added HTTP Request node after the Entra ID node, set the parameters, i hope it’s going to work now. Thanks for the assistance.

If there is anything else later, I’ll ask :slight_smile:

1 Like

Hey if you make it work and you have the time please let me know.

Also if my comment helped you please consider marking it as the solution. It will help me level up my rank in the community and it will help other people with the same issue.
Thanks.

1 Like

Well, gets a bit tricky. I kinda need help setting up HTTP request node for my problem with manager.

So, what URL do i add? Should I send Headers and Body?

1 Like

Hi,
For some reason I was mistaken that you were trying to get the ‘manager’ value not update it. Sorry for that :expressionless:

Looking at your update request it looks correct, headers, tokens, endpoints and all, but seems like you don’t have the necessary user ID and manager, user id for the update:
From the microsoft graph api documentation on assigning a manager to the user
id’s look like this: 10f17b99-784c-4526-8747-aec8a3159d6a

PUT https://graph.microsoft.com/v1.0/users/10f17b99-784c-4526-8747-aec8a3159d6a/manager/$ref
Content-type: application/json

{
  "@odata.id": "https://graph.microsoft.com/v1.0/users/6ea91a8d-e32e-41a1-b7bd-d2d185eed0e0"
}

To retrieve the user and manager id you will probably need to add 2 Microsoft Entra ID - Get Many Users’ nodes before the update to query by the available emails

  • User ID:
    • Filter: mail eq '{{ $json.workEmail }}' (replace {{ $json.workEmail }} with your email variable).
  • Manager ID:
    • Filter: mail eq '{{ $json.managerEmailFromBambooHR }}' (replace {{ $json.managerEmailFromBambooHR }} with the manager’s email variable from BambooHR)."
1 Like

So i need to add two more Microsoft Entra ID nodes? or just one? I’m a bit confused, kinda complicated myself this workflow. So, the flow would go like this: Webhook->BambooHR->Code->Update Reporting to (Http request node)->MS Entra ID Get Many Users x2?

1 Like

The update should go at the end. You need to lookup the user and manager ids first.

  1. Webhook
  2. Get BambooHR record
  3. Entra ID GetMany Users
    use the value from $("BambooHR").first().json["workEmail"] as a filter to lookup the user in Entra and get his id.
  4. Entra ID GetMany Users
    use the value from $("BambooHR").first().json["supervisor"] as a filter to lookup the manager user in Entra and get his id.
  5. Update Entra ID, use the collected Ids to update the manager



Not sure what you have in the ‘supervisor’ bamboo field. If it’s email it’s fine because emails are unique so you will be able to use it to lookup the same user in Entra.

So, i still have trouble with this workflow for updating users.
What i have to put in update is next: City, Department, Job title, Display name(optional) and MANAGER.
I’ve put all of that in Entra update node, but for manager i go with this as you told me to. but i have to manually add every time user id or i can get it from API graph?
here is the test that im still having trouble with:

Hi,
You can dynamically get the values from previous n8n nodes and build strings ‘the n8n way’ like this:

When the referenced node is executed the ids should be resolved and substituted.

Same for the body JSON:

Here is the updated workflow how i think it should work, but sadly i don’t have bamboo or entra right now so you should double-check the references.

Edit:
Also noticed that in the update node on the top you are still trying to update by the email of the user.

I moved it after the ‘get entra user’ node and updated the reference because you need an Entra user id to do an update, not an email.
Basically you use the emails to find the ids and then you work with the ids.

I did like you re-edit the workflow, but i get nothing when i execute node :confused:

Are you sure a user with this email exists in entra? from this screenshot it looks like it just doesn’t find it.

Yes yes, user exists :confused:

Hello,

Do you have maybe any update on this? what could be a problem?

Also, i have another problem when i want to create a user and add them to specific group (I have created a loop for that and its working properly but when i want to add them to groups there is and error 400). Is there any way to add users to distribution or security groups?

Thanks in advance.

Hi. Yes. the user exists, every time i try to start the workflow here is where get weird. Dont go pass this.

2 Likes

Just wanted to say that i have found a way to create workflow to update user in Entra ID from BambooHR. Workflow looks like this, comment before.

@Ventsislav_Minev One more question, you cannot add user in distribution group in Entra ID in workflow, right?

Hi @Todor , Happy to hear you solved it!

I’m not sure. In the official microsoft documentation on groups the Distribution lists are listed as Read only so probably not :frowning:


This screenshot is from this microsoft graph api documentation:

The Graph API has an Add Members endpoint and it doesn’t specifically mention distribution lists so you can try hitting it with the list id and the user id and see what happens :smiley:

POST https://graph.microsoft.com/v1.0/groups/{group-id}/members/$ref

Request Body

{
  "@odata.id": "https://graph.microsoft.com/v1.0/users/{user-id}"
}
1 Like