Synchra.24
menu_bookDocumentation
Practical guides for setup and development

Find guides for getting started, building workflows and adding your own tools to your company workspace.

folderAutomation

Synchra24 Event Launch

System and user service events: payload, conditions, restrictions, delivery, and examples of automations.

Machine translation

Event automation is triggered after a change in Synchra24 or calling a registered event from your service. It is suitable for processes like "if an event has occurred and the condition is met, send data or call an external service."

For example:

  • the employee was more than 15 minutes late. Send the record to an external system and notify the manager via its API;
  • An incident of high importance has been created. Please send it to the support service.;
  • the checklist with violations is completed — create an entry in the quality control system;
  • the task is completed — send the result to the accounting system.

How event launch works

After an action in Synchra24, the enabled automation receives an event with its name, time, and data. Then the conditions are checked, the handler is executed, and the result is sent to the configured destinations. The progress of the work and the result are available in the launch history.

Event-based automation does not poll services on a schedule and does not require a field source: the data is already in the event envelope.

What you need to set up

  • the company must have an active opportunity API integration;
  • the user needs access to the section Automation;
  • the configuration should use version: 2;
  • Automation must be enabled;
  • prepare the URL, authorization method, and secrets for the external API in advance.

In the editor, select the trigger type. event and specify one exact event name. Case and characters matter: task.completed and Task.Completed they are considered different strings.

User Service Events

The event belongs to one service and one company. First, save the service in the administrator, open the tab Events with a lightning bolt icon and create an event. For example, the local name report_ready for a service with an ID 42 gets the full code custom.service_42.report_ready. The same local key in another service does not overlap with this event. The company is determined by authorization on the server.

In the header of the automation editor, click the compact square button with a zipper Service Event next to the deletion. A separate modal opens with a search by events and services, pagination and loading states and an empty list. Select the enabled event from the company's services catalog and click Select an event. Button Cancel closes the window without changing the configuration. In trigger.event is used full code, and in the service code — local name. Automation must be enabled; creating an event definition does not trigger it by itself. You need a license to manage the service. Applications and the right to edit services; for automation — API integration and the right to edit integrations.

An example of a configuration that saves the result to an artifact:

version: 2
trigger:
  type: event
  event: custom.service_42.report_ready
transform:
  type: javascript
  timeout_seconds: 2
destination:
  type: artifact
  name: reports.latest

In the handler tab:

function transform(input, context) {
  return {
    report_id: input.payload.report_id,
    event_id: input.event_id,
    prepared_by: input.actor_user_id
  };
}

From the published service, the event is sent via synchra.emitEvent("report_ready", {report_id: "123"}, {requestKey}) after successful verification isSynchraIntegrated(). Payload data is a JSON object up to 32 KB. The method uses a previously created definition; there are no methods for registering events from the code. The server itself fills in the company, the author, and the official fields of the envelope. The full example of resending: Service Events.

The built-in preview returns {preview: true, accepted: false} and it doesn't start automation. Real sending returns event_id after saving the event for processing. This is a confirmation of acceptance, not a successful execution of the script: see the result in the automation history.

Key requestKey save it together with the unchanged payload for one operation. Repeating with the same key and data returns the previous one. event_id; protection is valid for at least 24 hours. Another load under the same key is deflected from 409. After you lose the response, repeat the previous operation instead of creating a new key.

Limitations of user events

The limits apply on the server to the entire company, regardless of the number of devices. The usual frequency is 30 calls per minute per user and event, 60 per user per company, 300 per service, and 1,000 per company. Short series are allowed; learn more about the restrictions — in the service manual. Up to 100 events can be registered in the service.

Up to 20 automations can be enabled for a single user event. Under heavy load, the startup may be waiting for processing. Answer 429 means that you need to wait before replaying.; 503 — that sending is temporarily unavailable. Show the error to the user and repeat the same operation with the same key without creating endless repetitions.

Method emitEvent currently available in the built-in the web engine services; the mobile bridge does not support it. The presence of the method in the web engine does not mean that it is available in any installed version of the npm package. @synchra24/app.

Event Catalog

The following are the system events that can be specified in trigger.event. Additionally, registered events of your company's services with the prefix are available. custom.service_. Field Payload shows the basic data for the conditions and the handler. In addition to them, in payload.title the name of the entity can be passed.

Tasks, incidents, and checklists

Event When it occurs The main payload fields
task.created A task has been created. id, number, title, assigned_to, priority_id, deadline
task.status_changed The task status has indeed changed. id, number, status, status_title, assigned_to, created_by
task.completed New issue status — completed. The event comes along with task.status_changed, but has a different event_id. the same fields as task.status_changed
task.canceled New issue status — canceled. the same fields as task.status_changed
incident.created An incident has been created. id, number, title, assigned_to, priority_id
incident.status_changed The status of the incident has indeed changed. id, number, status, status_title, assigned_to, created_by
incident.in_progress The incident has been upgraded to the status in_progress. the same fields as incident.status_changed
incident.completed The incident is completed, closed, or marked as unfulfilled. the same fields as incident.status_changed
checklist.submitted The result of the checklist has been sent. id, status, session_id, violations_count, has_failures
checklist.failed The submitted checklist contains at least one violation. the same fields as checklist.submitted

Time tracking

Event When it occurs The main payload fields
shift.started The employee's shift was started by himself, through the dashboard or by the supervisor. When the manager starts, his ID is passed to launching_user_id. timer_id, user_id, started_at, launching_user_id, panel_id, manual; if there is a schedule — planned_start, planned_end, late_minutes
shift.ended The active shift was stopped by an employee, panel, or supervisor. When the supervisor stops, his ID is sent to stopped_by_user_id. timer_id, user_id, started_at, ended_at, duration_seconds, stopped_by_user_id, manual
employee.late The shift started later than planned. fields shift.started, including late_minutes

Applications, forms, documents and reports

Event When it occurs The main payload fields
request.created The employee created the request. title
request.approved The application has been finalized. The event does not create an interim agreement for one participant. title
request.rejected The application was finally rejected. title
assessment_360.submitted The participant sent a 360° score. title
form.blank_completed The employee filled out the assigned form. dispatch_id, form_type, title
form.poll_completed The employee completed the assigned survey. dispatch_id, form_type, title
document.signed The employee signed the document. title
report.created A report has been created. date, session_id, title

Vacations, ideas, and cash register

Event When it occurs The main payload fields
vacation.requested The employee sent a vacation plan. subject_user_id, year, days, approver_ids, comment, title
vacation.approved The vacation plan has been agreed. subject_user_id, year, comment, title
vacation.canceled Vacation plan days have been canceled or rejected. subject_user_id, year, days, comment, title
vacation.updated The employee rescheduled the days of the existing vacation plan; the approval is reset. subject_user_id, year, removed_days, added_days, title
client_hub.employee_idea_created The employee sent the idea to the client hub. status, title
cash.transaction_created A receipt, expense, issue, or refund operation has been created. cashbox_id, type, amount, description, user_id, category_id, title
cash.transaction_canceled The cash transaction has been canceled. cashbox_id, type, amount, description, user_id, category_id, canceled_by, canceled_at, title

Calendar and news

Event When it occurs The main payload fields
calendar.event_created A calendar event has been created. starts_at, ends_at, location, user_ids, title
calendar.event_updated The calendar event has been changed. the same fields as calendar.event_created
calendar.event_deleted The calendar event has been deleted. title
news.created A news item has been created. show_from, show_to, title
news.updated The news has been changed. show_from, show_to, title
news.deleted The news has been deleted. title

Field work

Event When it occurs The main payload fields
field_visit.created A draft of the departure has been created. common exit fields
field_visit.updated The exit parameters have been changed. common exit fields
field_visit.published Check-out is published and assigned to employees. common exit fields
field_visit.departed The performer started moving towards the object. common fields and operation fields
field_visit.arrived The performer marked the arrival. common fields and operation fields
field_visit.completed Check-out is completed. common fields and operation fields
field_visit.canceled Check-out has been cancelled. common fields and operation fields

Common exit fields: number, status, priority, date, window_start, window_end, timezone, responsible_id, member_ids, title. For actions, they are also passed operation_id, offline, geo_state, reason and result. Repeated delivery of one offline operation does not create a new event.

Employees, departments, and roles

Event When it occurs The main payload fields
employee.added The user has been added to the company. user_id, position_id, title
employee.dismissed The employee is dismissed. profile_id, employment_status, title
employee.restored The dismissed employee has been reinstated. profile_id, employment_status, title
employee.blocked The employee's profile is blocked. profile_id, blocked, title
employee.unblocked The profile lock has been lifted. profile_id, blocked, title
department.created The administrator has created a department. department_id, name, description, title
department.updated The name or description of the department has been changed. department_id, name, description, title
department.deleted An empty department has been deleted. department_id, title
role.created The administrator created the role manually or through an AI role structure generator. A separate event is created for the generated role. role_id, name, description, parent_id, permissions, generated, title
role.updated The role, its parent, or rights have been changed. role_id, name, description, parent_id, permissions, title
role.deleted The role without child roles has been deleted. role_id, title
position.created A bid has been created or copied. position_id, division_id, name, work_mode, work_start, work_end, title; for a copy — copied_from_position_id
position.updated The bid or its work schedule has been changed. position_id, name, work_mode, work_start, work_end, title
position.archived The bid has been archived or restored. position_id, archived, title

Qualification admissions

Event When it occurs The main payload fields
qualification.created A type of qualification permit has been created. qualification_id, kind, name, description, validity_days, document_required, max_level, active, title
qualification.updated The parameters of the access type have been changed. the same fields as qualification.created
qualification.archived The type of access has been archived. qualification_id, active, title
employee_qualification.assigned The employee has been granted access. employee_qualification_id, user_id, qualification_id, qualification_name, kind, level, status, issued_at, expires_at, verified_by, title
employee_qualification.updated The employee's security clearance has been changed. the same fields as employee_qualification.assigned
employee_qualification.revoked The employee's security clearance has been revoked. the same fields; status equally revoked

Confirmation files and photos are not included in admission events.

Outfits

Event When it occurs The main payload fields
duty.created A draft of the outfit has been created or copied. duty_id, status, date, starts_at, ends_at, timezone, zone_id, zone_name, role_ids, user_ids, required_count, assigned_count, version, title; for a copy — copied_from_duty_id
duty.updated The parameters or assignments of the outfit have been changed. the main fields of the outfit
duty.published The order was published to the staff. the main fields of the outfit; status equally published
duty.canceled The outfit has been cancelled. the main fields of the outfit, reason; status equally canceled

Freelance staff and manual schedule days

Event When it occurs The main payload fields
external_worker.added A freelance employee with first assignments has been added. external_worker_id, assignment_ids, planned_starts, planned_ends, title
external_worker.assignment_created Appointments have been added to the existing freelance employee. the same fields as external_worker.added
external_worker.deleted The freelance employee was removed before the start of work. external_worker_id, title
external_worker.session_started The freelance employee started the assigned shift via the Motion panel. session_id, external_worker_id, assignment_id, panel_id, started_at, title
external_worker.session_ended The freelance employee's change was completed by himself or forcibly by the supervisor. session start fields, ended_at, duration_seconds, stopped_by_user_id, forced, title
schedule.workday_added A working day has been manually added to the schedule of one or more employees. date, user_ids, starts_at, ends_at, timezone, reason, title
schedule.day_off_added A non-working day has been manually added to the schedule. date, user_ids, reason, title
schedule.workday_updated The manually assigned working day has been changed. assignment_id, date, user_ids, starts_at, ends_at, timezone, reason, title
schedule.day_off_updated The manually assigned non-working day has been changed. assignment_id, date, user_ids, reason, title
schedule.day_removed The manual assignment of the day has been removed from the schedule. assignment_id, title

Exchange of shifts and replacements

Event When it occurs The main payload fields
shift_exchange.created An employee or supervisor has posted a replacement shift or an open shift. request_id, kind, requester_id, date, starts_at, ends_at, timezone, status, qualification_ids, title
shift_exchange.responded The employee responded to the posted shift. application fields, response_id, response_user_id, title
shift_exchange.response_withdrawn The employee has withdrawn his response to the posted shift. request_id, response_user_id, status, title
shift_exchange.approved The supervisor agreed on the response and the schedule change was completed. application fields, response_id, replacement_user_id, assignment_id, title
shift_exchange.canceled The request for an exchange or an open shift has been canceled. application fields, title
shift_replacement.created A direct replacement of employees between shifts has been created. replacement_id, first_date, first_user_ids, second_date, second_user_ids, reciprocal, reason, status, title
shift_replacement.updated The parameters of the direct replacement have been changed. the same fields as shift_replacement.created
shift_replacement.canceled The direct replacement has been canceled. the same fields as shift_replacement.created

Email, PIN codes, and freelance rates are not included in the events.

User sessions

Sessions are a separate service in the Applications tab of the mobile app. Access is granted with separate rights to view, manage visits, and approve access; supervisor rights and access to "Management" are not required. They do not apply to work shifts and payment calculations. Events occur after a confirmed change on the server and are saved along with the session history. The broker's unavailability does not lose the event: the publication is repeated through the outbox.

Event When it occurs
visit.created A session was created, including through the integration API.
visit.updated The planned dates, the object, the purpose, the car, the responsible person or the need for admission have been changed.
visit.arrived The employee confirmed the arrival or the visitor independently checked in via a personal link.
visit.entered The actual entrance to the territory has been confirmed.
visit.completed The visit has been completed; the issued pass has been revoked.
visit.cancelled The session was canceled before entering; the pass was revoked.
visit.no_show After the scheduled end, the employee noted the non-appearance.
visit.admission_allowed An authorized employee has allowed entry. This is not the fact of entry yet.
visit.admission_denied The authorized employee declined the admission.
visit.pass_issued A new personal QR pass has been issued; the previous one has been revoked.

For all these events source_service — time_manager, entity_type — visit, entity_id — session number. In payload a snapshot of the session is being transmitted: id, provider_id, guest (ID, full name, organization, and contacts), location, purpose, vehicle, vehicle_plate, comment, responsible_id, responsible_name, require_admission, status, admission, planned_start, planned_end, arrived_at, entered_at, completed_at, created_by, created_at, updated_at, version, external_system, external_id. Additionally available previous_status, action_comment, method (manual / qr / visitor) and changes. If available, they are transmitted guest.photo, self_arrival_enabled and arrival_details (geo_status, and upon successful detection — latitude, longitude, accuracy).

The secret of the QR pass and its hash are not included in the events and history. Scanning by itself does not change the state: the employee checks the card and confirms the action. If access is required, entry is allowed only after approval. For a repeat session, the same user and a new session record are used.

Automations can not only send this data to an external system, but also create/modify sessions via the provider-scoped API. /api/v1/tm/visits, confirm statuses via /{id}/status and access through /{id}/admission. When changing, you need the current one version; the conflict yields a 409. Couple external_system + external_id allows you to link a session to an external record and avoid re-creation when the request is delivered again. Similar filters are available for accurate search. When self-marking is enabled, the visitor can mark the arrival via a personal link: event visit.arrived receives method=visitor, actor_user_id=0 and arrival_details with the result of geolocation detection. A push is sent to the receiving employee; clicking it again does not duplicate the event. Admission to the territory remains a separate action of the employee. All methods are limited by the company, user rights, and a separate license. visits ("Sessions"), which is included in Trial, Pro, and Ultimate; a specific external system is not embedded in the session logic.

Example: transfer arrival to an external system

In the configuration, select one event and, if necessary, limit it to a specific object.:

version: 2
trigger:
  type: event
  event: visit.arrived
conditions:
  all:
    - path: payload.location
      operator: eq
      value: Склад №2

This is a fragment of the startup settings: add a JavaScript handler and HTTP destination in the editor. You can prepare the data in the handler:

function transform(input, context) {
  const visit = input.payload;
  return {
    event_id: input.event_id,
    visit_id: visit.id,
    external_system: visit.external_system,
    external_id: visit.external_id,
    status: visit.status,
    admission: visit.admission,
    arrived_at: visit.arrived_at,
    method: visit.method,
    arrival_details: visit.arrival_details || null
  };
}

Set up the HTTP destination address and authorization via Secrets. The external system must take into account event_id to protect against repeat shipping. Send the user's contacts only if the recipient needs them; there is no pass token in the event.

For visit.updated in changes.before and changes.after snapshots before and after the change are available. When marking yourself actor_user_id — line "0", and payload.method — visitor; coordinates may be missing. An empty geolocation does not mean a denial of access.

Repeated confirmation of an already achieved status does not create a new event. When using the incoming API, transmit the current version; when answering 409, reread the card, check the status, and only then repeat the acceptable action.

Learn more about the user scenario: Sessions. Integration methods: Open API.

Journals and knowledge base

Event When it occurs The main payload fields
journal.completed An employee completed a magazine event. journal_id, journal_title, event_title, completed_by, assignment_at, completion_source, reason, title
journal.force_completed The supervisor forcibly ended the event. the same fields; completion_source equally manager_override
wiki.article_created A knowledge base article has been created. section_id, title
wiki.article_updated The knowledge base article has been changed. title

Basic example: being more than 15 minutes late

version: 2

trigger:
  type: event
  event: employee.late

conditions:
  all:
    - path: payload.late_minutes
      operator: gte
      value: 15

transform:
  type: javascript
  timeout_seconds: 2

destination:
  type: http
  method: POST
  url: https://example.com/api/lateness
  headers:
    Authorization: "Bearer ${secrets.DESTINATION_TOKEN}"
  request:
    format: json

retry:
  attempts: 3
  delay_seconds: 5

Event automation does not have source: the source is the event itself. In the mode steps You can't add steps either. kind: source, but you can add multiple assignments.

Other examples of conditions

Urgent check-out completed

trigger:
  type: event
  event: field_visit.completed

conditions:
  all:
    - path: payload.priority
      operator: eq
      value: urgent

Cash transaction over 100,000

trigger:
  type: event
  event: cash.transaction_created

conditions:
  all:
    - path: payload.amount
      operator: gte
      value: 100000

Any personnel retirement

One automation listens to only one event name. To dismiss, use employee.dismissed. If you need to handle dismissal and blocking in the same way, create two automations or route both scenarios to one external endpoint.

Conditions

In conditions.all the conditions that must be fulfilled simultaneously are listed. In conditions.any it is enough to fulfill one condition. Both groups can be used together.

Operator Appointment
eq, ne Equal or not equal.
gt, gte, lt, lte Comparing numbers.
in The value is included in the specified array.
contains A string contains a fragment or an array contains a value.
exists The field exists; to verify its absence, specify value: false.

The path may refer to event_type, actor_user_id, entity_type, entity_id, source_service or fields payload For example payload.priority_id.

Handler Data

Function transform(input, context) receives the entire event envelope:

Field Type Description
event_id UUID A unique event identifier and a duplicate protection key.
schema_version number The envelope version. Currently in use 1.
event_type line The name of the event from the catalog above.
provider_id line Company ID.
actor_user_id line The user who performed the action. It may be empty for the system process.
source_service line The Synchra24 service that created the event.
entity_type line Type of entity: for example task, timer or field_visit.
entity_id line The ID of the entity.
occurred_at date and time The moment of the event in UTC in the ISO 8601 format.
correlation_id line ID of the associated chain of operations.
causation_id line ID of the cause event, if any.
depth number The depth of the automation chain, from 0 before 4.
payload object The data of a specific event.
{
  "event_id": "2dc81c0d-7bf5-4cd6-8837-57ce93730c50",
  "schema_version": 1,
  "event_type": "employee.late",
  "provider_id": "company-id",
  "actor_user_id": "42",
  "source_service": "time_manager",
  "entity_type": "timer",
  "entity_id": "123",
  "occurred_at": "2026-10-04T08:15:00Z",
  "correlation_id": "2dc81c0d-7bf5-4cd6-8837-57ce93730c50",
  "depth": 0,
  "payload": {
    "user_id": "42",
    "late_minutes": 15
  }
}

event_id It is unique and is used to protect against re-processing. correlation_id connects the actions of a single chain. The depth of the chain is limited to five levels so that automations cannot create an endless cycle.

In JavaScript, fields are read directly:

function transform(input, context) {
  return {
    eventId: input.event_id,
    companyId: input.provider_id,
    employeeId: input.actor_user_id,
    minutesLate: input.payload.late_minutes,
    receivedAt: context.started_at
  };
}

If the field does not relate to a specific event, it may be missing or have a value. null. Check optional fields before using them.

Delivery and protection from duplicates

Delivery is performed asynchronously. The user request does not wait for an external HTTP call to be executed: the created task, stopped shift, or other action is saved regardless of the automation result.

If the event fails, it can be delivered again. To prevent the external system from performing the same action twice, use event_id as a unique operation key. Synchra24 also protects the startup of a single automation from re-processing the same event.

Events of different actions can occur almost simultaneously. If the order is critical, compare occurred_at and the state of the entity in the external system.

Compatibility

  • the name of the existing event and the meaning of the current fields do not change unnecessarily.;
  • new optional fields may appear in payload;
  • The handler should not fail because of an unknown field.;
  • when creating a new incompatible structure, the schema_version;
  • dates are transmitted in UTC, unless otherwise specified in the field description.;
  • Monetary values are transmitted as a number in the currency used by the company's cashier.

Checking and launching

Perform a test run before enabling automation: it helps to check the conditions and the handler without sending the result to work assignments. To verify a specific event, prepare an example of its data. For more information about entering test data, see the verification guide.

One event launch is limited to 60 seconds. Operational event automation does not have the usual manual trigger: it is triggered by a selected event.

After the actual event, open the automation history and check:

  1. has there been a trigger launch event;
  2. Did it match event_type;
  3. Have the conditions been met;
  4. what is written in the input and output data;
  5. what messages did the handler output?;
  6. the response returned by the external endpoint.

If there is no launch, check the exact name of the event, the company, the enabled automation status, and the moment of the actual business action. If the result indicates condition_not_matched, the event was received, but did not pass conditions.

Learn more about debugging: Checking and troubleshooting errors. Token Storage Rules: Secrets and security.

Event from the card widget

The service widget can read the current record via await synchra.getWidgetContext() and pass her ID to your event data. synchra.emitEvent(). The context has the same wrapper in WebView and Shadow DOM; the description and entry fields are in data. Don't send an event every time the context or render is updated: use an explicit user action and steady requestKey for a single operation. Custom mobile bridge events are still only available in the methods supported by it.; emitEvent It is currently supported by the web bridge. More detailed: Widget Context.

Artifacts in event automation

Block artifacts: {settings: service.settings} connects the values of the current company without an HTTP source. The terms can read artifacts.settings.enabled and compare the event fields with ${artifacts.settings.minimum}; transform reads context.artifacts.settings. The assignments use the same set of values at the start of the startup. Recording from the service via setArtifact the event itself does not create: after successful saving, if necessary, call the registered emitEvent. Rules for reading and writing.