Describe the problem/error/question
What is the error message (if any)?
Please share your workflow
(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)
Share the output returned by the last node
Information on your n8n setup
- n8n version:
- Database (default: SQLite):
- n8n EXECUTIONS_PROCESS setting (default: own, main):
- Running n8n via (Docker, npm, n8n cloud, desktop app):
- Operating system:
Hello,
let me explain my situation.
I created a flow when a new user is created in Officient that new user account gets created in Azure. After that the login credentials gets sended with Whatsapp. I have configred Twilio(whatsapp) and also on Azure for the app creattion and permissions. And another flow when we remove a user in Officient the user get removed from Azure. I don’t get any error but when I do a test on Officient by creating a new user, the user is not created in Azure.
Hopefully someone can help me on this and point whats wrong in the code.
here are the two codes
for a new user in Officient
‘</>’
{
“name”: “Officient_NewUser_AzureAD_WhatsApp”,
“nodes”: [
{
"parameters": {
"httpMethod": "POST",
"path": "officient-new-user",
"options": {}
},
"id": "99930c0c-65da-4506-8e80-ab9e894fed76",
"name": "Officient Webhook Trigger",
"type": "n8n-nodes-base.webhook",
"typeVersion": 1,
"position": \[
0,
0
\],
"webhookId": "8dacf9bf-f9b9-43e0-88d3-738a8e04313c"
},
{
"parameters": {
"functionCode": "\\nitems\[0\].json.password = Math.random().toString(36).slice(-10) + \\"!\\";\\nreturn items;\\n"
},
"id": "9dbd62bb-86e6-4b5d-91e2-71fa8631f171",
"name": "Generate Password",
"type": "n8n-nodes-base.function",
"typeVersion": 1,
"position": \[
208,
0
\]
},
{
"parameters": {
"authentication": "oAuth2",
"requestMethod": "POST",
"url": "https://graph.microsoft.com/v1.0/users",
"options": {},
"bodyParametersUi": {
"parameter": \[
{
"name": "accountEnabled",
"value": "=true"
},
{
"name": "displayName",
"value": "=={{$json\[\\"first_name\\"\]}} {{$json\[\\"last_name\\"\]}}"
},
{
"name": "mailNickname",
"value": "=={{$json\[\\"first_name\\"\]}}"
},
{
"name": "userPrincipalName",
"value": "=={{$json\[\\"first_name\\"\]}}.{{$json\[\\"last_name\\"\]}}@thebeeacademy.be\\n"
},
{
"name": "passwordProfile\[password\]",
"value": "=\\"forceChangePasswordNextSignIn\\": true,\\n \\"password\\": \\"{{$json.password}}\\""
}
\]
},
"headerParametersUi": {
"parameter": \[
{
"name": "Content-Type",
"value": "application/json"
}
\]
}
},
"id": "b41be281-bd59-4f66-bfc7-9916f81d41d2",
"name": "Create Azure AD User",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 1,
"position": \[
400,
0
\],
"credentials": {
"oAuth2Api": {
"id": "WziFnlMSnaqMRH4N",
"name": "Unnamed credential 3"
}
}
},
{
"parameters": {
"authentication": "basicAuth",
"url": "https://api.twilio.com/2010-04-01/Accounts/{{ACCOUNT_SID}}/Messages.json",
"options": {}
},
"id": "b251297c-e7b1-4fc3-9f33-6c7fdab21260",
"name": "Send WhatsApp via Twilio",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 1,
"position": \[
608,
0
\],
"credentials": {
"httpBasicAuth": {
"id": "jYjlXCF6DNtdTOWn",
"name": "Unnamed credential 2"
}
}
}
],
“pinData”: {},
“connections”: {
"Officient Webhook Trigger": {
"main": \[
\[
{
"node": "Generate Password",
"type": "main",
"index": 0
}
\]
\]
},
"Generate Password": {
"main": \[
\[
{
"node": "Create Azure AD User",
"type": "main",
"index": 0
}
\]
\]
},
"Create Azure AD User": {
"main": \[
\[
{
"node": "Send WhatsApp via Twilio",
"type": "main",
"index": 0
}
\]
\]
}
},
“active”: true,
“settings”: {
"executionOrder": "v1"
},
“versionId”: “04a40101-3e88-40a4-b414-6908f3d32f93”,
“meta”: {
"templateCredsSetupCompleted": true,
"instanceId": "4a4aacf4b0f9f46b6f00299da3474e0b6161ba376dc6ca06aa09b02054c85bca"
},
“id”: “yODtPNtKeO4WB3kC”,
“tags”:
}
To remove the user
{
“name”: “Officient_DeleteUser_AzureAD”,
“nodes”: [
{
"parameters": {
"httpMethod": "POST",
"path": "officient-user-deleted",
"options": {}
},
"id": "webhook-node-id",
"name": "Officient Webhook Trigger",
"type": "n8n-nodes-base.webhook",
"typeVersion": 1,
"position": \[
0,
0
\],
"webhookId": "unique-webhook-id"
},
{
"parameters": {
"authentication": "oAuth2",
"url": "={{'https://graph.microsoft.com/v1.0/users/' + $json\[\\"email\\"\]}}",
"options": {},
"headers": {
"Content-Type": "application/json"
},
"method": "DELETE"
},
"id": "delete-user-node-id",
"name": "Delete Azure AD User",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 1,
"position": \[
300,
0
\],
"credentials": {
"oAuth2Api": {
"id": "your-oauth2-credential-id",
"name": "Azure OAuth2 Credential"
}
}
}
],
“connections”: {
"Officient Webhook Trigger": {
"main": \[
\[
{
"node": "Delete Azure AD User",
"type": "main",
"index": 0
}
\]
\]
}
},
“active”: true,
“settings”: {
"executionOrder": "v1"
},
“versionId”: “workflow-version-id”,
“id”: “workflow-id”,
“tags”:
}