# Workflows

> Automate repetitive work with triggers, conditions and actions — branching on conditions, waiting, HTTP requests, AI steps, manual and scheduled runs.

**Workflows** (sidebar → Workflows, admins) run actions on records in order when something happens — an opportunity is created, a stage changes, an email arrives from a company… — or at a set time. The editor reads top to bottom: **Trigger → Conditions → Steps**. (Labels are shown in Turkish in the app.)

## Triggers {#triggers}

| Trigger | Object | When |
|---|---|---|
| Opportunity created · Opportunity stage changed | Opportunity | Right after saving |
| Opportunity idle for N days · Stage time (SLA) exceeded | Opportunity | Daily check |
| Company created · Company visit overdue | Company | Immediately · daily |
| Fair lead entered · Visit / call logged · Support ticket opened | The record | Immediately |
| Contract end approaching | Contract | Daily |
| Email received from a company | Email | During sync |
| **Run manually** — opportunity / company | Opportunity · Company | When a user starts it |
| **Scheduled** — opportunities / companies | Opportunity · Company | Every day / week / month at a chosen hour |

**Manual** workflows run from the **Workflow** button on opportunity and company pages, or from the **Workflow** menu in the bottom bar for selected records in a table view (edit rights on the record are required).

A **scheduled** workflow runs once per period, for every record matching its conditions (at most 500 records per run). Example: *Every Monday 09:00 — add an AI summary note to open opportunities*.

## Conditions {#conditions}

All conditions must hold: field + operator (=, ≠, contains, ≥, ≤, empty, not empty) + value. Opportunity and company [custom fields](/concepts/custom-fields) can be used too. Without conditions the workflow runs for every triggering record.

## Steps {#actions}

| Step | What it does |
|---|---|
| Create task | Title, due in N days, assignee, type, priority |
| Send notification | To the record owner, the workflow's creator, a chosen user, or all admins |
| Assign owner · Add tag · Update field | Changes the record (custom fields included) |
| Send email (template) · Add to email sequence | Email / sequence to the contact (sequences need the Email Automation module) |
| Send to app | Slack, Teams, Telegram, webhook… ([Apps](/guides/apps)) |
| **Branch on condition** | Runs the *If yes* steps when conditions hold, otherwise the *If no* steps |
| **Wait** | Continues the remaining steps after N days / hours |
| **Send HTTP request** | Calls your own system (ERP, automation without Zapier) |
| **AI step** | Classifies, summarizes or writes to an instruction; writes the result to a custom field or as a note on the record |

Texts can use variables: `{firma}` `{fırsat}` `{aşama}` `{sorumlu}` `{tutar}` `{kişi}` `{lead}` `{fuar}` `{konu}` `{gün}` (company, opportunity, stage, owner, amount, contact, lead, fair, subject, days).

### Branch on condition {#branch}

A branch has its own conditions (independent of the workflow's conditions). Add as many steps as you like to each arm; branches and waits can't be nested inside an arm. An empty arm means "do nothing".

### Wait {#wait}

At a Wait step the workflow pauses and queues the remaining steps; when the time is up (via the 10-minute scheduler) it continues from where it stopped. With **Re-check conditions when the time is up**, the workflow's conditions are checked again before continuing — if they no longer hold (e.g. the opportunity moved on in the meantime), the workflow stops. Wait can't be the last step. If the workflow is disabled or deleted, queued steps don't run.

> Template **Post-presentation follow-up (wait + branch)**: when an opportunity moves to Present Solution, create a task → wait 5 days → if it's still in the same stage, notify the owner and the admins.

### Send HTTP request {#http}

Method (POST, PUT, PATCH, GET, DELETE), URL (`https://` and public addresses only; variables allowed), optional headers (one `Name: value` per line) and body.

With **Send record data as JSON** checked the body looks like this (text in the body field is added as `message`):

```json
{
  "event": "workflow",
  "workflow": "Send to ERP",
  "workflow_id": 7,
  "kind": "opp",
  "id": 412,
  "url": "https://acme.solk.app/opportunities/412",
  "data": {"owner": "3", "c_status": "AC", "c_city": "İzmir", "stage": "Win", "value": 324000.0, "prob": 100, "tag": "", "...": "..."},
  "vars": {"firma": "Egemen Group A.Ş.", "fırsat": "Proje · 2026", "...": "..."},
  "sent_at": "2026-10-04T14:20:05",
  "message": "Proje · 2026 won"
}
```

`data` holds the field values used by conditions (`owner` = user id, `c_*` = the company's fields, custom fields as `cf_<key>`).

Unchecked, the body is sent as written (with variables filled in) — `Content-Type: application/json` if it's valid JSON, plain text otherwise. With a **signing secret** the request carries `X-Solk-Signature: sha256=<HMAC-SHA256(secret, body)>` — verified the same way as [webhooks](/guides/webhooks). A non-2xx response fails the step; the result shows in the **Runs** tab. Requests time out after 15 seconds.

### AI step {#ai}

| Operation | Result |
|---|---|
| Classify | Picks one of the options you give (or the options of the target select field) |
| Summarize | Summarizes the record's current state in a few sentences |
| Write to instruction | Answers your instruction using the record's information (*"Suggest the next step in one sentence"*) |

The result is written to a text / long text / select [custom field](/concepts/custom-fields) of the opportunity or company, or as a **note on the record**. The AI receives a summary of the record: stage, amount, owner, custom fields, stage history, company details, contacts' names and titles, recent calls, notes and recent email subjects. Contacts' email addresses and phone numbers are never sent. If AI is off for the organization the step fails and nothing is sent; every run counts toward AI usage.

## Runs and limits {#runs}

- The **Runs** tab shows each run with record, result and a step summary (*HTTP POST erp.example.com → 200 · branch: no · tag 'Small deal' · waiting → 06.10.2026*).
- Changes made by a workflow don't trigger other workflows (no loops).
- More than 200 events in one request (such as a bulk import) don't run workflows.
- Workflows don't run on sample-data records.