URL: /code/files/workflows · Id: `page:/code/files/workflows`

# The workflows/ folder: one file and what it compiles to

> What one workflows/ file holds, what each key compiles to, and the checks that read it.

One `workflows/` file is one sales [Process](https://startupbuilder.dev/business/nouns/process), holding only what differs from the hub’s. SalesBuilder compiles it, and `show` traces every key.

```mdx title="workflows/outbound.mdx"
---
process: outbound
hours: "Mon-Fri 08:00-17:00 America/Chicago"
---
Outbound sends only in Dana’s working hours.
```

```text title="show"
$ npx startup-builder show workflows/outbound.mdx
process  outbound                               workflows/outbound.mdx:2
hours    "Mon-Fri 08:00-17:00 America/Chicago"  workflows/outbound.mdx:3
owner    SalesBuilder
```

```text title="leaseline.app"
leaseline.app/
├── plays/
│   ├── cold-email.mdx
│   ├── warm-intros.mdx
│   ├── signup-interviews.mdx
│   ├── lead-reactivation.mdx
│   └── events-and-webinars.mdx
├── audiences/
│   ├── small-property-managers.mdx
│   ├── lapsed-leads.mdx
│   └── renewal-season.mdx
├── sequences/
│   └── cold-email-thread-founder.mdx
├── funnels/
│   └── signup.mdx
├── workflows/   ← this folder
│   └── outbound.mdx
├── agents/
│   ├── sales/prospector.mdx
│   └── marketing/content-lead.mdx
├── systems/
│   └── sequences.mdx
├── domains/
│   └── leaseline.app.mdx
├── offers/
│   ├── pro.mdx
│   └── team.mdx
├── content/
│   └── webinars/60-day-notices.mdx
├── metrics/
│   ├── q4.mdx
│   └── positive-reply-rate.mdx
└── startups.lock
```

## The file
| Key | On the page | Compiles to | Checked by |
| --- | --- | --- | --- |
| `process` | Automation | the hub Process it overrides, by id | — |
| `hours` | Sends in | the window every send of the Process waits for | — |

## Refusals
| Code | Fix, then the call that clears it |
| --- | --- |
| [`availability`](/code/refusals#check-availability) | Offer only free calendar slots, and fix any line that says it ships; it pauses until fixed. Then <Op verb="Meeting.book" />. |
| [`exit-never-waits`](/code/refusals#check-exit-never-waits) | Leave the cancel standing; the Customer takes it back with one press while access lasts. Then <Op verb="Subscription.keep" />. |
| [`no-meeting-held`](/code/refusals#check-no-meeting-held) | Book a call with the buyer and hold it, then send the proposal again. Then <Op verb="Meeting.book" />. |
| [`price`](/code/refusals#check-price) | Get the discount approved, or quote at the floor. Then <Op verb="Approval.approve" />. |
| [`question-cap`](/code/refusals#check-question-cap) | Hold the rest for one Meeting with their admin. Then <Op verb="Meeting.book" />. |
| [`recording`](/code/refusals#check-recording) | Ask each attendee on the call, then start recording. Then <Op verb="Meeting.book" />. |
| [`renewal-notice`](/code/refusals#check-renewal-notice) | Send the renewal notice with its amount; the renewal waits 30 days after it. Then <Op verb="Message.schedule" />. |
| [`stage-fields`](/code/refusals#check-stage-fields) | Fill each field the refusal names, then move the Deal on again. Then <Op verb="Deal.update" />. |
| [`kill-switch`](/code/refusals#stop-kill-switch) | Review what fired, then turn the Process back on. Then <Op verb="Process.enable" />. |

## Calls

```text title="workflows/ compiled · Ask"
Turn on outbound and show me what it did.
```

```ts title="workflows/ compiled · SDK"
import { $ } from 'startup-builder'

await $.Process.enable({ process: 'process_1' }, { mode: 'try' })   // workflows/outbound.mdx
return await $.Action.list({ limit: 20 })   // every Action, with its status
```

```json title="workflows/ compiled · Response · sample"
{
  "$type": "Action",
  "actions": [
    {
      "$id": "https://api.sb/leaseline.app/actions/action_1",
      "$type": "Action",
      "status": "pending",
      "mode": "try"
    }
  ],
  "meta": {
    "limit": 20,
    "after": "cursor_2"
  }
}
```

| Call | What it does |
| --- | --- |
| <a id="process-enable"></a><Op verb="Process.enable" /> | Enable turns a Process on for a Startup, so its Workflows start on their Triggers. Emits [`Process.enabled`](/code/events#process-enabled). |
| <a id="process-pause"></a><Op verb="Process.pause" /> | Pause stops a Process from starting new Actions; Actions already in progress finish. Emits [`Process.paused`](/code/events#process-paused). |
| <a id="meeting-book"></a><Op verb="Meeting.book" /> | Book schedules a Meeting with a Contact at a time both calendars hold free. Emits [`Meeting.booked`](/code/events#meeting-booked). |
| <a id="deal-advance"></a><Op verb="Deal.advance" /> | Advance moves a Deal to its next stage once every field that stage requires is filled. Emits [`Deal.advanced`](/code/events#deal-advanced). |
| <a id="deal-win"></a><Op verb="Deal.win" /> | Win closes a Deal as won, which places its Order and makes the buyer a Customer. Emits [`Deal.won`](/code/events#deal-won). |
| <a id="quote-send"></a><Op verb="Quote.send" /> | Send presents a drafted Quote to its buyer and freezes its lines, total and payment terms. Emits [`Quote.sent`](/code/events#quote-sent). |
| <a id="renewal-open"></a><Op verb="Renewal.open" /> | Open starts the Renewal for a term Subscription before its term ends. Emits [`Renewal.opened`](/code/events#renewal-opened). |
| <a id="subscription-keep"></a><Op verb="Subscription.keep" /> | Keep takes back a cancel before the period closes, so the Subscription renews on its date at the same terms. Emits [`Subscription.kept`](/code/events#subscription-kept). |

| Not live yet | Use today |
| --- | --- |
| `Referral.invite` | [Gaps #3](/code/reference#gap-referral-invite). Today: One ask as a <Op verb="Message.schedule" />. |