Skip to content

Job Automator — Config (Local vs WebApi)

Jump to

Note: If you’re new to the Job Automator, start with the Introduction. If you’re scaffolding a new service or want to see the recommended structure, check the Project Template. For a starting point on the API side, see GitHub – JobAutomator Template.

This notes covers:

"RunMode": "WebApi", // "Local" or "WebApi"
"LocalConnectionStrings": {
  "LocalAutomationsPath": "C:\\Services\\JobAutomator\\Automations",
  "LocalPostgres": {
    "Jobs": "",
    "Scalars": ""
  },
  "TaskRepositoryConnectionString": ""
}

What these do

  • RunMode
    • "WebApi" → Uses remote Domain Services/Web API repositories.
    • "Local" → Uses local repositories so you can test automations on your machine.
  • LocalConnectionStrings.LocalAutomationsPath
    • Folder that contains your automation JSON files.
    • Used only in RunMode: "Local" (read via a directory repository).
  • LocalConnectionStrings.LocalPostgres.Jobs
    • PostgreSQL connection string for Jobs in Local mode.
    • Leave empty → Jobs are kept in memory (ephemeral; resets on restart).
  • LocalConnectionStrings.LocalPostgres.Scalars
    • PostgreSQL connection string for Scalars in Local mode.
    • Leave empty → Scalars are kept in memory (ephemeral).
  • LocalConnectionStrings.TaskRepositoryConnectionString
    • Optional source for Task/Workflow definitions in Local mode.
    • Leave empty → Tasks are served from an in-memory stub (good enough for “is trigger met?” checks).

Note: Leaving Jobs and Scalars empty is perfect for quick local testing, and nothing is written to a database; you’re just verifying whether automations evaluate to “met” and how jobs would be queued.


How to switch

  1. Set "RunMode": "Local".

  2. Point LocalAutomationsPath to your local automations folder.

  3. Decide persistence:

    • Fast test (recommended): leave LocalPostgres.Jobs and LocalPostgres.Scalars empty → in-memory.

    • Persist locally: set them to PostgreSQL connection strings.

  4. (Optional) Provide TaskRepositoryConnectionString if you have a local task source; otherwise keep it empty.


Minimal examples

A. Pure in-memory local testing (no DB):

"RunMode": "Local",
"LocalConnectionStrings": {
  "LocalAutomationsPath": "C:\\Services\\JobAutomator\\Automations",
  "LocalPostgres": { "Jobs": "", "Scalars": "" },
  "TaskRepositoryConnectionString": ""
}

B. Local with Postgres persistence for jobs & scalars:

"RunMode": "Local",
"LocalConnectionStrings": {
  "LocalAutomationsPath": "C:\\Services\\JobAutomator\\Automations",
  "LocalPostgres": {
    "Jobs": "Host=localhost;Database=jobs;Username=...;Password=...",
    "Scalars": "Host=localhost;Database=scalars;Username=...;Password=..."
  },
  "TaskRepositoryConnectionString": ""
}

C. Remote/Web API (original behavior):

"RunMode": "WebApi",
"LocalConnectionStrings": {
  "LocalAutomationsPath": "C:\\Services\\JobAutomator\\Automations",
  "LocalPostgres": { "Jobs": "", "Scalars": "" },
  "TaskRepositoryConnectionString": ""
}

Related: Job Automator — Introduction · Project Template · *GitHub – JobAutomator Template