CSM Administration - How do I setup and configure Automations?
Understanding and setting up CSM Automation Routines and Job Queues to run in the background.
CSM Automations run your commerce activities — order retrieval, sales order creation, inventory sync, fulfillment updates and listing management — on a schedule, driven by Business Central job queue entries.
A set of predefined automations is loaded for you when your Sales Channel is set up. In most cases you will adjust frequencies and enable or disable individual tasks rather than build automations from scratch.
Before you start
CSM ships two automation models. Which one you use depends on your channel - for the purpose of this documentation, we are assuming you are on the latest version of CSM.
-
API Automation is the current model, built on API Engine. It organizes work into Automation Groups containing Automation Steps, and records every run in Run History.
-
CSM Automation List is the earlier model, a single flat list of automation records grouped by a Codeunit ID Code. Some channels still load their automations here. This is going to be deprecated in the future.
Search Business Central for API Automation and for CSM Automation List. Whichever page contains records for your Sales Channel is the model you are on. If you have records in both, both are executed.
API Automation (current model)
Applies to: Walmart, Shopify, BigCommerce, WooCommerce, Magento
Search for API Automation and select the related link. You will see a list of Automation Groups. Open a group to see its Automation Steps and its run history.
Automation Groups
| Field | Description |
|---|---|
| Code | Unique identifier for the group, for example ORDER_MANAGEMENT. This is the value you enter as the Parameter String on a job queue entry. |
| Description | Plain-language summary of what the group does. |
| Sequence | Execution order relative to other groups. Lower numbers run first. |
| Enabled | When cleared, none of the steps in the group will run. Changing this offers to enable or disable every step in the group with you. |
| Type | Classifies the group so the Role Center buttons can find it. CSM supplies CSM Order Management, CSM Listing Management and CSM B2B Management. |
Automation Steps
| Field | Description |
|---|---|
| Enabled | Include this step when the group runs. Clear it to skip the step or run it only on demand. |
| Sequence | Execution order within the group. Some steps depend on an earlier step having completed. |
| Code | Unique identifier for the step. Do not modify on a supplied step. |
| Description | Plain-language summary of what the step does. |
| Type | API runs against an API Set rather than a specific Sales Channel. Order processes CSM Orders. Fulfillment pushes fulfillment data to the channel. Listing exchanges listing data between Business Central and the channel. B2B exchanges companies, contacts and locations. |
| Scheduled Frequency | The minimum interval between runs of this step. |
| Last Run Timestamp | Updated automatically after a successful run. The step is due when Last Run Timestamp + Scheduled Frequency has passed. A blank timestamp means the step is always due. |
| API Set Code | The API Set providing the step's underlying functionality. |
| API Function Code | The specific API function used to move the data, where applicable. |
| CSM Properties | Execution criteria specific to this step. Drill into the count to view and edit them. |
| Update Last Run Timestamp on Error | Stamp the timestamp even when the step fails. By default it is stamped only on success, so a failed step retries on the next pass. |
Enabling a step
If you enable a step whose Last Run Timestamp is blank, CSM asks whether to set it to the current date and time. Answer Yes unless you intend the step to run immediately and process everything currently outstanding.
CSM Properties
Properties carry the step's criteria and are created automatically based on the step's Type. Common properties include:
| Property | Purpose |
|---|---|
| SALES_CHANNEL | Restricts the step to a single Sales Channel. Leave blank to process all. |
| CHANNEL_TYPE | The channel platform the step applies to. |
| SUBTYPE | The specific action the step performs, for example ARCHIVE or BUILD_SO. |
|
ORDER_STATUS CHANNEL_STATUS_VALUE BC_ORDER_STATUS |
Status criteria that determine which orders the step picks up. Order steps only. |
|
AUTO_CREATE_SO AUTO_RELEASE_SO AUTO_POST_SO |
Actions to take on the resulting Business Central sales order. Order steps only. |
| REQUIRE_UPDATE_ONLY | Process only records flagged External Requires Update. Listing steps only. |
| MAX_RUN_TIME | Stops the step after the given duration so a long-running task cannot monopolize the job queue. See Long-running steps below. |
Running steps on demand
From the Automation Steps list you can:
- Run — executes the selected steps immediately, regardless of schedule. If a selected step is disabled you are asked to confirm.
- Duplicate — copies the selected steps, useful when you need the same task against a second Sales Channel.
- View Run History — opens the execution history filtered to that step.
Run History
Every automation run is recorded, whether it was started by a job queue, a Role Center button or the Run action. Open it from an Automation Group, from a step, or by searching API Automation Run History. Each entry records:
- Group code, automation code and description
- Start time, end time and duration in milliseconds
- Status, error message and error call stack
- Number of API calls made, with a link to the API Messages
- Triggered By (Manual or Job Queue), the executing user, and the job queue entry and log entry
Run History is the first place to look when an automation is not producing the results you expect.
Status: Unknown
A status of Unknown does not mean the step failed. It means another Suite Engine app took over execution of that step and did not report back whether it succeeded. Check the resulting records or API Messages to confirm the outcome.
Scheduling with Job Queue Entries
Running steps manually is fine for testing. For production, schedule them with standard Business Central job queue entries.
- Search for Job Queue Entries and select the related link
- Choose New
- Set Object Type to Run to Codeunit
- Set Object ID to Run to 70338473 (SENAPI Automation Job Queue)
- In Parameter String, enter the Automation Group Code you want this entry to run, for example
ORDER_MANAGEMENT. Leave it blank to run every enabled group in sequence - Configure recurrence per standard Business Central practice
Running Multiple Job Queues
In high-volume or multi-channel environments, create a separate Automation Group per channel or per workload and give each its own job queue entry. This spreads the processing load and keeps a failure in one channel from delaying the others.
Long-Running Steps
By default a step processes every eligible record and commits the result as a single transaction. This is efficient, but an interruption rolls back the whole run.
If a step regularly fails to complete, set the MAX_RUN_TIME property to a duration. The step then stops cleanly once that duration has elapsed and picks up where it left off on the next pass. Remove the value once record volume returns to a manageable level.
CSM Automation List (earlier model)
Applies to: Amazon
-
Search for CSM Automation List and select the related link
-
This is a single flat list rather than groups and steps
-
| Field | Description |
|---|---|
| Sales Channel Code | The Sales Channel this record applies to. Can be blank for tasks that serve multiple channels or where a channel does not apply. |
| Automation Type | API, Order, Fulfillment, Listing, Financial, Inventory or Housekeeping. |
| Sequence | Execution order within a Codeunit ID Code. |
| Code | Unique identifier for the automation record. |
| Codeunit ID Code | Groups records for scheduling. Defaults are ORDERMGTDEFAULT and LISTINGMGTDEFAULT. This is the value you enter as the Parameter String on a job queue entry. |
| Scheduled | Include this record when the automation runs. Clear it to run the record only on demand. |
| Scheduled Frequency | The minimum interval between runs. |
| Last Run Timestamp | Updated after each run and combined with Scheduled Frequency to decide eligibility. |
| Maximum Run Time | Caps how long the record may run. See Housekeeping below. |
|
Order Status Channel Status Value Order Status (BC) |
Status criteria for Order-type records. |
|
Auto Create SO Auto Release SO Auto Post SO |
Actions to take on the resulting Business Central sales order. Order-type records only. |
|
API Set Code API Function Code |
The API Set and function used to move the data. |
Use the Run Automation action to execute selected records immediately.
Scheduling with Job Queue Entries
| To schedule | Object ID to Run | Default Parameter String |
|---|---|---|
| Order Management | 70338218 | ORDERMGTDEFAULT |
| Listing Management | 70338219 | LISTINGMGTDEFAULT |
Set Object Type to Run to Codeunit, enter the Object ID above, and enter the Codeunit ID Code you want to run in Parameter String. If Parameter String is left blank, the default shown above is used.
Housekeeping
Housekeeping is a Housekeeping-type record in this model. It performs two jobs:
- Deletes API Messages and Processing Log entries according to the retention period defined in CSM Setup
- Archives CSM Orders according to each Sales Channel's archiving settings
Schedule housekeeping during a low-activity period, such as overnight, and run it regularly. Tables that are never cleaned will grow until additional storage is required.
Retention Policies
For deleting data, we recommend Business Central's standard retention policies rather than the housekeeping automation. Housekeeping remains necessary for CSM Order archiving.
By default housekeeping identifies all eligible records and commits the deletion as a single transaction. If the volume is too large for the record to complete reliably, populate Maximum Run Time. The record then deletes one record at a time for the specified duration, making each deletion permanent regardless of interruption. This is slower but guaranteed. Remove the value once volume is manageable again.
Order Archiving in the Current Model
There is no Housekeeping type under API Automation. Order archiving is handled by an Automation Step with a SUBTYPE property of ARCHIVE. Use Business Central retention policies for the data deletion side.
Role Center Buttons
The CSM Role Center provides Run Order Automation Now, Run Listing Automation Now and Run B2B Automation Now. These are convenience actions for testing and for catching up after an outage; they are not a substitute for scheduled job queues.
Each button runs both models at once:
- Every CSM Automation List record whose Codeunit ID Code is the default (
ORDERMGTDEFAULTorLISTINGMGTDEFAULT) - Every enabled Automation Group whose Type matches — CSM Order Management, CSM Listing Management or CSM B2B Management
Custom Automations and the Buttons
A custom Automation Group is picked up by these buttons as long as its Type is set correctly. A custom CSM Automation List record with a non-default Codeunit ID Code is not picked up — it will only run from its own job queue entry or from the Run Automation action.
Troubleshooting
- A step never runs. Check that both the step and its parent Automation Group are Enabled, and that Last Run Timestamp plus Scheduled Frequency has actually elapsed.
- A step runs but nothing happens. Review its CSM Properties. A
SALES_CHANNELor status property that no longer matches your data will select zero records. - A step fails repeatedly. Open Run History for the error message and call stack, and check the linked API Messages for the channel's response.
- A job queue entry finishes instantly. Confirm the Parameter String matches an existing Automation Group Code exactly. An unmatched filter selects no groups.
- The job queue keeps timing out. Split the work across multiple groups and job queue entries, or set
MAX_RUN_TIMEon the heaviest steps.