But adding that user to a group for them to access something I'm finding much tricker to automate.
First you'd have to find the group and then get the Object ID. But you also need to Object ID of the user you just invited.
Getting the Object ID of the user is tricky because the invite itself generates an ID in the ID field, but that's not the Object ID. That's hidden in the InvitedUser field, which contains other data too.
Getting the user via email address doesn't work, so this was the quickest way I could work it out: