Automation artifacts
Saving JSON data within the company, version, and API.
Machine translation
An artifact is a named JSON value that an automation or service stores in Synchra24 for its company. This allows you to receive data from an external system, transform it, and store the latest result for reading and updating via the API and service bridge. The data is saved after the service is restarted.
For example, automation receives balances from the accounting system once an hour and stores them under the name warehouse.stock. Another integration reads this artifact without re-accessing the source.
Setting up an appointment
In the single-source configuration, replace the HTTP destination:
version: 1
trigger:
type: schedule
cron: "0 * * * *"
timezone: Europe/Moscow
source:
type: http
method: GET
url: https://accounting.example.com/api/stock
headers:
Authorization: "Bearer ${secrets.ACCOUNTING_TOKEN}"
response:
format: json
transform:
type: javascript
timeout_seconds: 2
destination:
type: artifact
name: warehouse.stock
The handler returns the data to save:
function transform(input, context) {
if (!Array.isArray(input.items)) {
throw new Error('Источник не вернул список остатков');
}
return { items: input.items, received_at: context.started_at };
}
The archive icon button in the configuration editor helps you add such an assignment. In the mode source/destination it replaces the previous assignment; in the mode steps adds another step.
Save and send at the same time
In steps you can combine HTTP destinations and artifacts. Sources can read HTTP or a saved artifact (type: artifact, name). Example of a step:
- id: stock_snapshot
kind: destination
type: artifact
name: warehouse.stock
input: ${transform.output.stock}
Without input the entire handler result is saved. The selector supports object fields, similar to HTTP assignments. They are not needed for the artifact. url, method, headers, request, response and body; these fields are prohibited. You cannot write the same artifact name twice in the same pipeline.
The artifacts support manual launches, schedules, and events. For events, the following are used version: 2 and trigger.type: event, the source is not specified. In steps HTTP source data is available to the handler by their id: for example, input.stock_source.
Updates and errors
- The first record creates version 1. Each subsequent record completely replaces the value and increases the version. The content history of previous versions is not stored.
- A source, handler, or save error leaves the previous artifact available. If the data has an incorrect structure, the handler must explicitly throw an error.
- The test run does not record anything. To create an artifact, save the pipeline and perform a normal startup.
- Assignments are executed in parallel. If the HTTP assignment fails, the successfully recorded artifact remains saved; there is no common transaction with external services.
- When writing the same name from different pipelines at the same time, the last completed entry wins. Restarting also increases the version, even if the value matches.
- There is no automatic deletion deadline. When a pipeline is deleted, its artifacts remain until explicitly deleted.
pipeline_idandrun_idthey show the origin of the last record and can refer to an already deleted history. Manual recording clears these fields.
Viewing and manual operation
In the section Administration → Automation → Artifacts The list, viewing JSON, manual creation, replacement and deletion are available. The list shows the name, size, current version, and update time. The content is loaded when a separate artifact is opened.
The deletion is irreversible. If automation remains enabled, the next successful launch will recreate the artifact.
API
All methods are limited to the current company. You need an active license API and the right admin_edit_provider_integrations. An artifact from another company cannot be read or changed, even if you know its name.
| Method | Way | Appointment |
|---|---|---|
| GET | /api/v1/automations/artifacts |
A list of metadata without content. |
| GET | /api/v1/automations/artifacts/item?name=warehouse.stock |
Metadata and the meaning of a single artifact. |
| POST | /api/v1/automations/artifacts/upsert |
Create or completely replace a value. |
| DELETE | /api/v1/automations/artifacts/delete?name=warehouse.stock |
Delete the artifact. |
For external integration, send X-OpenAPI-Token and X-Provider-Token the same company. Obtaining tokens is described in The Integration Guide. The listed methods are intended for the Open API; services inside Synchra24 work with artifacts through the SDK.
POST body:
{ "name": "warehouse.stock", "value": { "items": [{ "sku": "A01", "quantity": 12 }] } }
value — A JSON value, not a string with serialized JSON. An object, array, string, number, boolean, and explicit are allowed. null; absence value unacceptable.
All responses are returned in a shared shell. code, status, message, result. Reading a single artifact:
{
"code": 200,
"result": {
"name": "warehouse.stock",
"value": { "items": [{ "sku": "A01", "quantity": 12 }] },
"size_bytes": 39,
"version": 1,
"created_at": "2026-10-13T09:00:00Z",
"updated_at": "2026-10-13T09:00:00Z"
}
}
POST returns the saved artifact; DELETE — result: { "deleted": true }; list — result: { "items": [...] } without value. Invalid name/JSON — 400, lack of access — 403, missing artifact — 404, exceeding quota — 409.
Restrictions and security
The name starts with a Latin letter and contains Latin letters and numbers., ., _, - and it has a length of up to 128 characters. The case is taken into account. A maximum of 100 artifacts per company, up to 1 MiB of serialized JSON per value, and up to 64 MiB in total. Updating an existing name is allowed when the quantity limit is reached, if there is enough space.
Artifacts are intended for application data. Store passwords, API keys, and tokens in secret variables: The contents of the artifact are available to users with integration management rights.
Reading from Hybrid Microapps
To read from the service, use the SDK method. getArtifact(name). Before reading, check your Synchra24 connection and handle a possible access error or missing data.
const synchra = new SynchraApp("SERVICE_TOKEN");
const snapshot = await synchra.getArtifact<{
items: { sku: string; quantity: number }[];
}>("warehouse.stock");
console.log(snapshot.value.items);
console.log(snapshot.version, snapshot.updated_at);
The bridge verifies the token of the open internal service, and the mobile application executes the request from the current user and the company. The Bearer token and the company's token are not transferred to the microapplication. You don't need to specify the company, API URL, or headers.
The result contains name, value, size_bytes, version, created_at, updated_at and optional source IDs pipeline_id, run_id. Saved null returns as value: null. The type in TypeScript describes the expected data, but does not replace the structure check when reading.
The same API rights apply: license API and admin_edit_provider_integrations. The bridge does not grant additional rights to the user. If the artifact is not found, access is denied, or the network is unavailable, the Promise is rejected. In the old version of the mobile app that does not support the bridge event, it will work responseTimeout SDK. Provide the status of unavailable data in the microapp interface.
Recording from the service
The built-in SDK is available setArtifact(name, value). Method completely replaces the existing value, increases the version and returns the saved artifact. Create a name in advance through artifact management or the usual automation startup. If the name is deleted or does not exist, the record returns a 404 and does not recreate it.
if (await synchra.isSynchraIntegrated()) {
const saved = await synchra.setArtifact('warehouse.stock', {
items: [{sku: 'A01', quantity: 12}]
});
console.log(saved.version);
}
Call up the recording after the user's confirmed action, show waiting and error. Recording does not trigger automation automatically: if necessary, send the registered service event separately. When writing in parallel, the last successful write wins; there is no partial merge and no version history. An entry from the service clears pipeline_id and run_id the last launch.
The previous restrictions apply: license API, right admin_edit_provider_integrations, current company, open service token, JSON up to 1 MiB and a total quota of 64 MiB. The bridge does not grant additional rights. An external SDK that does not yet have a convenient method may cause synchra.requestPayload('app.automation.artifact.set', {name: 'warehouse.stock', value: {...}}). An updated build with support for this event is needed on the mobile device. In the built-in editor, the method is already included in the SDK.
In the preview, you can change only existing test artifacts the "Test artifacts" tabs. Repeated reading will see the changed value and version. Restarting the preview resets these changes; the actual company data does not change.
Reading at any stage of automation
Connect the necessary names in the upper block artifacts. The key is a short alias, the value is the real name of the artifact of the current company:
version: 2
trigger:
type: manual
artifacts:
settings: service.settings
source:
type: artifact
name: warehouse.stock
conditions:
all:
- path: artifacts.settings.enabled
operator: eq
value: true
transform:
type: javascript
timeout_seconds: 2
destination:
type: http
url: https://accounting.example.com/api/stock
headers:
X-Location: '${artifacts.settings.location}'
Separate handler:
function transform(input, context) {
const minimum = context.artifacts.settings.minimum;
return {items: input.items.filter(item => item.quantity >= minimum)};
}
Access to values:
| Stage | How to read |
|---|---|
source |
type: artifact + name reads the entire value. The HTTP source accepts substitutions in url, headers and body. |
conditions |
path: artifacts.settings.enabled; in value substitution is allowed ${artifacts.settings.minimum}. The source fields are available via input, event fields — as before. |
transform |
Synchronous reading context.artifacts.settings, without network requests and await. |
destination |
Substitutions in HTTP url, headers, body; in the destination step input: ${artifacts.settings} or a nested field instead of the transform result. |
Numbers are treated like regular JavaScript numbers; store identifiers outside of a secure integer in strings.
Full substitution in JSON ('${artifacts.settings.minimum}') saves the type of value: the number remains a number, the object remains an object. Inside the string, the value is converted to text. The URL and title should receive a string when fully substituted. The fields of objects are separated by dots; the array index is a number (${artifacts.settings.items.0.id}). For body The HTTP destination explicitly specified template replaces the body from the transform result; without body the old behavior persists.
The engine loads only connected artifacts and source artifacts at the start of the launch, each name is loaded once. All stages of this run use these loaded values. Updating the artifact by another client or destination will be visible to the next launch; there is no common atomic transaction between the different names. Change context.artifacts in JavaScript, it does not record data and does not change the values of substitutions in other stages.
Up to 20 aliases per day artifacts; alias starts with a Latin letter and contains up to 64 Latin letters, numbers, or _. The names constructor, prototype, __proto__ reserved. Up to 50 different input names in total, totaling up to 5 MiB of JSON. A missing artifact, an unconnected alias, or a missing field in the substitution stops the startup with an error. Condition exists it can be used for an optional field of an existing artifact.
To check the conditions based on an artifact, use a test run before enabling automation.
The verification run reads the real input artifacts of the current company, checks the conditions and transform, but does not trigger the assignment and does not record anything. Values are available in manual, scheduled, and event-based automations; for an event source still not specified.