Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. N8N
  3. Add users to Cloudron - N8N

Add users to Cloudron - N8N

Scheduled Pinned Locked Moved N8N
12 Posts 5 Posters 2.0k Views 5 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Sam_uk
    Oct 21, 2021, 3:48 PM

    So I made a N8N flow that takes user-submitted email addresses from a form.io form.

    I can create users and generate the signup emails, however, I'm stuck at adding them to groups

    My flow is below, can anyone shed any light?

    {
      "name": "Add to groups",
      "nodes": [
        {
          "parameters": {},
          "name": "Start",
          "type": "n8n-nodes-base.start",
          "typeVersion": 1,
          "position": [
            250,
            300
          ]
        },
        {
          "parameters": {
            "projectId": "6168084eb35ff178dd907fd7",
            "formId": "61680a64e1092633bce1b86c",
            "events": [
              "create"
            ],
            "simple": false
          },
          "name": "Form.io Trigger",
          "type": "n8n-nodes-base.formIoTrigger",
          "typeVersion": 1,
          "position": [
            450,
            450
          ],
          "webhookId": "c923b1b2-2794-44b3-9dce-a3c3936b06d1",
          "credentials": {
            "formIoApi": {
              "id": "3",
              "name": "Form.io account 2"
            }
          }
        },
        {
          "parameters": {
            "requestMethod": "POST",
            "url": "=https://my.cloudron-url.org/api/v1/users/{{$node[\"create user\"].json[\"email\"][\"id\"]}}/create_invite?access_token=xxxxkeyfromcloudronxxxxxxx&_method=post",
            "options": {}
          },
          "name": "Create invite",
          "type": "n8n-nodes-base.httpRequest",
          "typeVersion": 1,
          "position": [
            870,
            420
          ]
        },
        {
          "parameters": {
            "requestMethod": "POST",
            "url": "=https://my.cloudron-url.org/api/v1/users/{{$node[\"create user\"].json[\"email\"][\"id\"]}}/send_invite?access_token=xxxxkeyfromcloudronxxxxxxx&_method=post",
            "options": {}
          },
          "name": "send invite",
          "type": "n8n-nodes-base.httpRequest",
          "typeVersion": 1,
          "position": [
            1070,
            420
          ]
        },
        {
          "parameters": {
            "requestMethod": "POST",
            "url": "=https://my.cloudron-url.org/api/v1/users/?access_token=xxxxkeyfromcloudronxxxxxxx&_method=post",
            "responseFormat": "string",
            "dataPropertyName": "email",
            "options": {},
            "bodyParametersUi": {
              "parameter": [
                {
                  "name": "=email",
                  "value": "={{$node[\"Form.io Trigger\"].json[\"data\"][\"email\"]}}"
                }
              ]
            }
          },
          "name": "create user",
          "type": "n8n-nodes-base.httpRequest",
          "typeVersion": 1,
          "position": [
            650,
            450
          ]
        },
        {
          "parameters": {
            "requestMethod": "PUT",
            "url": "=https://my.cloudron-url.org/api/v1/users/{{$node[\"create user\"].json[\"email\"][\"id\"]}}/groups?access_token=xxxxkeyfromcloudronxxxxxxx",
            "responseFormat": "string",
            "dataPropertyName": "=groups",
            "jsonParameters": true,
            "options": {},
            "bodyParametersJson": "={\n\"groupIds\": [ ]\n}",
            "queryParametersJson": "=users"
          },
          "name": "add to /users",
          "type": "n8n-nodes-base.httpRequest",
          "typeVersion": 1,
          "position": [
            1250,
            410
          ]
        }
      ],
      "connections": {
        "Form.io Trigger": {
          "main": [
            [
              {
                "node": "create user",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "Create invite": {
          "main": [
            [
              {
                "node": "send invite",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "send invite": {
          "main": [
            [
              {
                "node": "add to /users",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "create user": {
          "main": [
            [
              {
                "node": "Create invite",
                "type": "main",
                "index": 0
              }
            ]
          ]
        }
      },
      "active": true,
      "settings": {},
      "id": 7
    }
    
    S Offline
    S Offline
    Sam_uk
    wrote on Oct 21, 2021, 4:11 PM last edited by
    #2

    Just making sure groupIds= groupname in Cloudron?

    The default 'user' group ID would be 'user' for example?

    girishG 1 Reply Last reply Oct 21, 2021, 4:31 PM
    0
    • S Sam_uk
      Oct 21, 2021, 4:11 PM

      Just making sure groupIds= groupname in Cloudron?

      The default 'user' group ID would be 'user' for example?

      girishG Do not disturb
      girishG Do not disturb
      girish
      Staff
      wrote on Oct 21, 2021, 4:31 PM last edited by girish Oct 21, 2021, 4:32 PM
      #3

      @sam_uk I guess you are looking for the API call to add a user to a group ?

      So, you make a PUT request on /api/v1/users/:userId/groups with groupIds in the body. groupIds is an array of group ids.

      Group ids are not the same as group name. You have to get the ids via the GET /api/v1/groups call. This is because group names can be changed.

      S 1 Reply Last reply Oct 21, 2021, 5:21 PM
      3
      • girishG girish
        Oct 21, 2021, 4:31 PM

        @sam_uk I guess you are looking for the API call to add a user to a group ?

        So, you make a PUT request on /api/v1/users/:userId/groups with groupIds in the body. groupIds is an array of group ids.

        Group ids are not the same as group name. You have to get the ids via the GET /api/v1/groups call. This is because group names can be changed.

        S Offline
        S Offline
        Sam_uk
        wrote on Oct 21, 2021, 5:21 PM last edited by
        #4

        @girish said in Add users to Cloudron - N8N:

        /api/v1/groups

        Thanks, it hangs with

        {
          "groupIds": [
            "gid-2155eeef-b8bd-45f5-9473-xxx"
          ]
        }
        

        But that's progress! I'll investigate further tomorrow.

        1 Reply Last reply
        1
        • girishG Do not disturb
          girishG Do not disturb
          girish
          Staff
          wrote on Oct 21, 2021, 5:28 PM last edited by
          #5

          You should get something like this:

          $ curl 'https://my.domain.com/api/v1/groups?access_token=xxx'
          {
            "groups": [
              {
                "id": "gid-02fc23f0-c0df-4276-a54a-e3958b53ffd8",
                "name": "people",
                "source": "",
                "userIds": [
                  "uid-0a7dc777-c010-459e-a8db-ab853ea4f742"
                ]
              }
            ]
          }
          
          1 Reply Last reply
          1
          • 10 months later
          • S Sam_uk
            Oct 21, 2021, 3:48 PM

            So I made a N8N flow that takes user-submitted email addresses from a form.io form.

            I can create users and generate the signup emails, however, I'm stuck at adding them to groups

            My flow is below, can anyone shed any light?

            {
              "name": "Add to groups",
              "nodes": [
                {
                  "parameters": {},
                  "name": "Start",
                  "type": "n8n-nodes-base.start",
                  "typeVersion": 1,
                  "position": [
                    250,
                    300
                  ]
                },
                {
                  "parameters": {
                    "projectId": "6168084eb35ff178dd907fd7",
                    "formId": "61680a64e1092633bce1b86c",
                    "events": [
                      "create"
                    ],
                    "simple": false
                  },
                  "name": "Form.io Trigger",
                  "type": "n8n-nodes-base.formIoTrigger",
                  "typeVersion": 1,
                  "position": [
                    450,
                    450
                  ],
                  "webhookId": "c923b1b2-2794-44b3-9dce-a3c3936b06d1",
                  "credentials": {
                    "formIoApi": {
                      "id": "3",
                      "name": "Form.io account 2"
                    }
                  }
                },
                {
                  "parameters": {
                    "requestMethod": "POST",
                    "url": "=https://my.cloudron-url.org/api/v1/users/{{$node[\"create user\"].json[\"email\"][\"id\"]}}/create_invite?access_token=xxxxkeyfromcloudronxxxxxxx&_method=post",
                    "options": {}
                  },
                  "name": "Create invite",
                  "type": "n8n-nodes-base.httpRequest",
                  "typeVersion": 1,
                  "position": [
                    870,
                    420
                  ]
                },
                {
                  "parameters": {
                    "requestMethod": "POST",
                    "url": "=https://my.cloudron-url.org/api/v1/users/{{$node[\"create user\"].json[\"email\"][\"id\"]}}/send_invite?access_token=xxxxkeyfromcloudronxxxxxxx&_method=post",
                    "options": {}
                  },
                  "name": "send invite",
                  "type": "n8n-nodes-base.httpRequest",
                  "typeVersion": 1,
                  "position": [
                    1070,
                    420
                  ]
                },
                {
                  "parameters": {
                    "requestMethod": "POST",
                    "url": "=https://my.cloudron-url.org/api/v1/users/?access_token=xxxxkeyfromcloudronxxxxxxx&_method=post",
                    "responseFormat": "string",
                    "dataPropertyName": "email",
                    "options": {},
                    "bodyParametersUi": {
                      "parameter": [
                        {
                          "name": "=email",
                          "value": "={{$node[\"Form.io Trigger\"].json[\"data\"][\"email\"]}}"
                        }
                      ]
                    }
                  },
                  "name": "create user",
                  "type": "n8n-nodes-base.httpRequest",
                  "typeVersion": 1,
                  "position": [
                    650,
                    450
                  ]
                },
                {
                  "parameters": {
                    "requestMethod": "PUT",
                    "url": "=https://my.cloudron-url.org/api/v1/users/{{$node[\"create user\"].json[\"email\"][\"id\"]}}/groups?access_token=xxxxkeyfromcloudronxxxxxxx",
                    "responseFormat": "string",
                    "dataPropertyName": "=groups",
                    "jsonParameters": true,
                    "options": {},
                    "bodyParametersJson": "={\n\"groupIds\": [ ]\n}",
                    "queryParametersJson": "=users"
                  },
                  "name": "add to /users",
                  "type": "n8n-nodes-base.httpRequest",
                  "typeVersion": 1,
                  "position": [
                    1250,
                    410
                  ]
                }
              ],
              "connections": {
                "Form.io Trigger": {
                  "main": [
                    [
                      {
                        "node": "create user",
                        "type": "main",
                        "index": 0
                      }
                    ]
                  ]
                },
                "Create invite": {
                  "main": [
                    [
                      {
                        "node": "send invite",
                        "type": "main",
                        "index": 0
                      }
                    ]
                  ]
                },
                "send invite": {
                  "main": [
                    [
                      {
                        "node": "add to /users",
                        "type": "main",
                        "index": 0
                      }
                    ]
                  ]
                },
                "create user": {
                  "main": [
                    [
                      {
                        "node": "Create invite",
                        "type": "main",
                        "index": 0
                      }
                    ]
                  ]
                }
              },
              "active": true,
              "settings": {},
              "id": 7
            }
            
            A Online
            A Online
            andreasdueren
            wrote on Aug 6, 2022, 2:31 PM last edited by
            #6

            @Sam_uk Hi Sam I would like to build something similar. Did you get it to work properly?

            S P 2 Replies Last reply Aug 9, 2022, 4:04 PM
            2
            • A andreasdueren
              Aug 6, 2022, 2:31 PM

              @Sam_uk Hi Sam I would like to build something similar. Did you get it to work properly?

              S Offline
              S Offline
              Sam_uk
              wrote on Aug 9, 2022, 4:04 PM last edited by
              #7

              @andreasdueren No sorry we ended up going with Keycloak for user management.

              1 Reply Last reply
              1
              • S Sam_uk
                Oct 21, 2021, 3:48 PM

                So I made a N8N flow that takes user-submitted email addresses from a form.io form.

                I can create users and generate the signup emails, however, I'm stuck at adding them to groups

                My flow is below, can anyone shed any light?

                {
                  "name": "Add to groups",
                  "nodes": [
                    {
                      "parameters": {},
                      "name": "Start",
                      "type": "n8n-nodes-base.start",
                      "typeVersion": 1,
                      "position": [
                        250,
                        300
                      ]
                    },
                    {
                      "parameters": {
                        "projectId": "6168084eb35ff178dd907fd7",
                        "formId": "61680a64e1092633bce1b86c",
                        "events": [
                          "create"
                        ],
                        "simple": false
                      },
                      "name": "Form.io Trigger",
                      "type": "n8n-nodes-base.formIoTrigger",
                      "typeVersion": 1,
                      "position": [
                        450,
                        450
                      ],
                      "webhookId": "c923b1b2-2794-44b3-9dce-a3c3936b06d1",
                      "credentials": {
                        "formIoApi": {
                          "id": "3",
                          "name": "Form.io account 2"
                        }
                      }
                    },
                    {
                      "parameters": {
                        "requestMethod": "POST",
                        "url": "=https://my.cloudron-url.org/api/v1/users/{{$node[\"create user\"].json[\"email\"][\"id\"]}}/create_invite?access_token=xxxxkeyfromcloudronxxxxxxx&_method=post",
                        "options": {}
                      },
                      "name": "Create invite",
                      "type": "n8n-nodes-base.httpRequest",
                      "typeVersion": 1,
                      "position": [
                        870,
                        420
                      ]
                    },
                    {
                      "parameters": {
                        "requestMethod": "POST",
                        "url": "=https://my.cloudron-url.org/api/v1/users/{{$node[\"create user\"].json[\"email\"][\"id\"]}}/send_invite?access_token=xxxxkeyfromcloudronxxxxxxx&_method=post",
                        "options": {}
                      },
                      "name": "send invite",
                      "type": "n8n-nodes-base.httpRequest",
                      "typeVersion": 1,
                      "position": [
                        1070,
                        420
                      ]
                    },
                    {
                      "parameters": {
                        "requestMethod": "POST",
                        "url": "=https://my.cloudron-url.org/api/v1/users/?access_token=xxxxkeyfromcloudronxxxxxxx&_method=post",
                        "responseFormat": "string",
                        "dataPropertyName": "email",
                        "options": {},
                        "bodyParametersUi": {
                          "parameter": [
                            {
                              "name": "=email",
                              "value": "={{$node[\"Form.io Trigger\"].json[\"data\"][\"email\"]}}"
                            }
                          ]
                        }
                      },
                      "name": "create user",
                      "type": "n8n-nodes-base.httpRequest",
                      "typeVersion": 1,
                      "position": [
                        650,
                        450
                      ]
                    },
                    {
                      "parameters": {
                        "requestMethod": "PUT",
                        "url": "=https://my.cloudron-url.org/api/v1/users/{{$node[\"create user\"].json[\"email\"][\"id\"]}}/groups?access_token=xxxxkeyfromcloudronxxxxxxx",
                        "responseFormat": "string",
                        "dataPropertyName": "=groups",
                        "jsonParameters": true,
                        "options": {},
                        "bodyParametersJson": "={\n\"groupIds\": [ ]\n}",
                        "queryParametersJson": "=users"
                      },
                      "name": "add to /users",
                      "type": "n8n-nodes-base.httpRequest",
                      "typeVersion": 1,
                      "position": [
                        1250,
                        410
                      ]
                    }
                  ],
                  "connections": {
                    "Form.io Trigger": {
                      "main": [
                        [
                          {
                            "node": "create user",
                            "type": "main",
                            "index": 0
                          }
                        ]
                      ]
                    },
                    "Create invite": {
                      "main": [
                        [
                          {
                            "node": "send invite",
                            "type": "main",
                            "index": 0
                          }
                        ]
                      ]
                    },
                    "send invite": {
                      "main": [
                        [
                          {
                            "node": "add to /users",
                            "type": "main",
                            "index": 0
                          }
                        ]
                      ]
                    },
                    "create user": {
                      "main": [
                        [
                          {
                            "node": "Create invite",
                            "type": "main",
                            "index": 0
                          }
                        ]
                      ]
                    }
                  },
                  "active": true,
                  "settings": {},
                  "id": 7
                }
                
                B Offline
                B Offline
                BrutalBirdie
                Partner
                wrote on Aug 9, 2022, 10:18 PM last edited by
                #8

                @luckow take a look at this 🙂

                Like my work? Consider donating a drink. Cheers!

                1 Reply Last reply
                1
                • A andreasdueren
                  Aug 6, 2022, 2:31 PM

                  @Sam_uk Hi Sam I would like to build something similar. Did you get it to work properly?

                  P Offline
                  P Offline
                  plusone-nick
                  wrote on Aug 10, 2022, 12:41 AM last edited by
                  #9

                  @andreasdueren I have recently built a reg page with the same features but using Wappler/PHP and the LAMP app in Cloudron
                  Currently cleaning up the project and plan on releasing it for the community =]

                  ✌💙+1

                  A 1 Reply Last reply Aug 10, 2022, 2:37 PM
                  8
                  • P plusone-nick
                    Aug 10, 2022, 12:41 AM

                    @andreasdueren I have recently built a reg page with the same features but using Wappler/PHP and the LAMP app in Cloudron
                    Currently cleaning up the project and plan on releasing it for the community =]

                    A Online
                    A Online
                    andreasdueren
                    wrote on Aug 10, 2022, 2:37 PM last edited by
                    #10

                    @plusone-nick Awesome! Please keep me updated

                    P 1 Reply Last reply Aug 13, 2022, 9:49 PM
                    2
                    • A andreasdueren
                      Aug 10, 2022, 2:37 PM

                      @plusone-nick Awesome! Please keep me updated

                      P Offline
                      P Offline
                      plusone-nick
                      wrote on Aug 13, 2022, 9:49 PM last edited by plusone-nick Aug 22, 2022, 2:23 AM
                      #11

                      @andreasdueren Quick update! I have completed the port over to PHP along with a new front end design =] Here is a quick demo with +1 theming:

                      Next I will be forking the project to make the Cloudron Community Theme & also scrub any keys/URLs

                      Here is the git repo where I will publish: https://git.plusone.network/nick/cloudron-registration-community
                      Currently there is only the readme notes but you can check them out in the meantime if anyone is interested in how Wappler works or would like more insight into how the app is designed. I have screenshots and code snippets of all of the API's & Variables. There are 5 items that must be changed (2 URL's, 2 ENV Variables & 1 Config Secret Key) and then its as simple as dropping it into a LAMP app! =]

                      EDIT: Forgot to leave the URL: https://join.plusonenetwork.xyz/
                      This is on my test/demo org so feel free to register& try it out yourself! I will be purging this instance eventually or you can message me to remove your user if you'd like

                      I do plan on adding more security/validation features in the near future but this should do for now...

                      Any thoughts or suggestions are more than welcome! =]

                      ✌💙+1

                      P 1 Reply Last reply Aug 22, 2022, 2:24 AM
                      9
                      • 8 days later
                      • P plusone-nick
                        Aug 13, 2022, 9:49 PM

                        @andreasdueren Quick update! I have completed the port over to PHP along with a new front end design =] Here is a quick demo with +1 theming:

                        Next I will be forking the project to make the Cloudron Community Theme & also scrub any keys/URLs

                        Here is the git repo where I will publish: https://git.plusone.network/nick/cloudron-registration-community
                        Currently there is only the readme notes but you can check them out in the meantime if anyone is interested in how Wappler works or would like more insight into how the app is designed. I have screenshots and code snippets of all of the API's & Variables. There are 5 items that must be changed (2 URL's, 2 ENV Variables & 1 Config Secret Key) and then its as simple as dropping it into a LAMP app! =]

                        EDIT: Forgot to leave the URL: https://join.plusonenetwork.xyz/
                        This is on my test/demo org so feel free to register& try it out yourself! I will be purging this instance eventually or you can message me to remove your user if you'd like

                        I do plan on adding more security/validation features in the near future but this should do for now...

                        Any thoughts or suggestions are more than welcome! =]

                        P Offline
                        P Offline
                        plusone-nick
                        wrote on Aug 22, 2022, 2:24 AM last edited by
                        #12

                        here is the first release: https://forum.cloudron.io/topic/7546/open-registration-app-for-cloudron

                        ✌💙+1

                        1 Reply Last reply
                        3
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes

                        11/12

                        Aug 13, 2022, 9:49 PM


                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        11 out of 12
                        • First post
                          11/12
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • Bookmarks
                        • Search