Setting Up Dedicated User to Run Automations
JustOn software supports running automated processes under a dedicated technical user rather than under a personal administrator account. Personal user accounts are tied to individuals. When an employee leaves the company or the internal IT setup changes, their account is usually deactivated – and the scheduled jobs that run under it start to fail. A dedicated technical user provides a stable, role-independent owner for all automated processes. It also makes permission management cleaner and auditable.
This article describes how to set up such a user and how to hand over existing automations to it.
Summary
Setting up a dedicated technical user under which to run automated processes usually involves the following tasks:
- Identify org-specific characteristics to clarify the execution context
- Creating the dedicated user
- Rescheduling existing automated jobs
- Reauthorizing any existing external integrations
- Enabling the technical user to use the org-wide email sender address
- Reviewing any existing custom automations
- Finally, testing and verifying the new setup
Note
Do not confuse the dedicated automation user with the platform integration user (for JustOn Billing & Invoice Management or for JustOn Cash Management). The platform integration user is an explicit, org-wide unique setting that JustOn software uses for the communication between Salesforce and the JustOn platform. The user described here is the running user of your scheduled jobs, which Salesforce determines implicitly when a job is scheduled.
Technically, you can use a single user account to cover both the platform integration and the automation. However, to keep these concepts separate, JustOn recommends to create two distinct user accounts.
Clarifying Execution Context
Determine the following org specifics before you change anything:
- Which JustOn applications are in use – JustOn Billing & Invoice Management, JustOn Cash Management, and any connectors or extensions.
- Whether external integrations rely on a connected app, named credentials or an auth provider – for example, payment service providers, accounting systems or e-invoicing portals.
- Whether your org has custom flows or Apex classes that filter on record ownership.
- Whether a sandbox is available for testing the switch before applying it to the production environment.
Setting Up Dedicated User
The dedicated user does not need to be associated with a real person, but it requires the same access as any other user who works with JustOn:
-
Create the user, and assign a Salesforce user license.
For details about the required license type, see Which Salesforce user license is required for JustOn?
-
Assign a JustOn license.
Navigate to Setup > Installed Packages, then click Manage Licenses in the row of the relevant JustOn package.
-
Assign the required permission sets, and enable the access to custom settings and the flow execution.
For JustOn Billing & Invoice Management, see Enabling Access for New Users.
For JustOn Cash Management, see Assigning Permissions.
If the dedicated user is to access external systems via the API, enable the API access as well.
-
Enable the access to the relevant connected app for the platform integration.
For JustOn Billing & Invoice Management, see Enabling App Access for JustOn Platform.
For JustOn Cash Management, see Enabling Access to JustOn Cash Management Connected.
A missing app access produces permission errors that surface only when the automation actually runs.
Rescheduling Jobs
Note
This is the step that is most easily overlooked. In Salesforce, the running user of a scheduled job is determined when the job is scheduled and cannot be changed afterwards. Reassigning ownership, deactivating the previous user or editing the job has no effect on the running user – the jobs must be deleted and scheduled again under the dedicated user.
To hand over a scheduled job:
- Click to enter Setup, then open Scheduled Jobs.
- Delete the job concerned, and confirm the operation.
- Log in as the dedicated user (or have it logged in).
-
Schedule the job again as described in Scheduling a Job.
This recreates the scheduled job, relating the dedicated user as the running user.
Repeat this for all JustOn jobs of your org – like InvoiceRunChain, DunningRunChain or ExportChain, see Scheduling Concepts – as well as for any custom Apex jobs that work on JustOn data.
The EmailJobChain requires a different procedure, because JustOn creates the corresponding scheduled job when a user sends an invoice email manually for the first time. For details, see Special Case: EmailJobChain.
Reauthorizing External Integrations
Connected apps, named credentials and auth providers hold a user-specific authorization. If your org integrates external systems, reauthorize them under the dedicated user:
- Click to enter Setup, then navigate to Apps > Connected Apps > Manage Connected Apps.
- Verify that the dedicated user is permitted to use the relevant connected apps.
- Reauthorize the affected connections, and update any named credentials or auth providers that reference the previous user.
For data replication via the JustOn Connector, see Setting Up JustOn Connector.
Enabling Email Sender Address
JustOn Billing & Invoice Management sends invoice and dunning emails using the address specified in the Email Sender field of the template or the business entity, which must be available as an organization-wide email address. The dedicated user must be permitted to use this address.
For details, see Email Sender Address.
If the dedicated user is not permitted to use the configured sender address, the email job completes without an error, but the emails are not sent.
Reviewing Custom Automations
JustOn Billing & Invoice Management or JustOn Cash Management do not depend on record ownership. Custom flows or Apex classes, however, may filter on the records of the current user – for example, using a "my records" filter or OwnerId = UserInfo.getUserId(). These automations produce different results once they run under the dedicated user, and must be reviewed and adjusted to use an explicit user reference or another filter criterion.
Verifying Setup
Before applying the setup to the production environment, run a complete business cycle under the dedicated user – preferably in a sandbox. A typical workflow may be, for example:
- Create a subscription, and let the subscription builder run.
- Execute an invoice run.
- Execute a payment run.
- Execute a dunning run.
- Verify that the invoice emails have been sent.
Check the job execution in Setup > Apex Jobs and the delivered emails to confirm that no step fails silently.
Related information:
Scheduling Jobs
How to fix failed jobs due to inactive users?
Enabling Access for New Users
Can I use permission set groups?