# Outputs, drafts and approvals

Source: https://docs.coderhelm.com/plugins/outputs

What a plugin run produces, how drafts are reviewed, and how nothing goes out without an approval of the exact version.

> Coming soon: this page describes work that is not on main yet.

<Callout type="info" title="Coming soon">Plugins are being built and switched on team by team; they are not on main yet. This page follows the work in progress and will be updated when plugins ship.</Callout>

## Drafts [#drafts]

A run saves what it makes as **drafts**. Declare the kinds a run may save:

```yaml
outputs:
  - type: draft
    kinds: [blog, social, email]
```

Kinds are `blog`, `social`, `email`, `image` and `action` (a step to take, such as an update to a record). Drafts wait in **Plugins** → **Review**: "Read one, edit it if needed, then approve it to go out now or at a time you pick."

| Status | Means |
| --- | --- |
| Draft | Saved by the run. |
| In review | Waiting for an approver. |
| Approved | An approver said yes to this exact version. |
| Scheduled | Approved for a set time; it can be cancelled until then. |
| Published | Sent out by the publish tool, with a link to the result. |
| Rejected | Turned down. |
| Stopped | Stopped for good: nothing from this draft can go out. |
| Cancelled | A scheduled publish was cancelled. |
| Failed | The publish tool reported an error. |

Editing a draft saves a new version. An approval waiting on the old version moves to the new one and must be given again.

## Publishing [#publishing]

```yaml
outputs:
  - type: publish
    via: publish_post          # a consequential tool from `tools`
    approval:
      role: marketing_editor   # who should approve
      min: 1                   # how many different people
```

A `publish` output names the consequential tool that sends an approved draft out. That tool runs only:

1. after the required number of approvers say yes,
2. with the exact version they approved,
3. approved by people other than the one who asked for the draft,
4. now (**Approve and publish now**), or at the time the approver picked (**Approve for that time**).

A scheduled publish can be cancelled until its time (**Cancel publish**); the draft stays approved in the history, and approving it again picks a new time.

**Stop for good** is permanent: nothing from that draft can be approved or go out afterwards, even if it is edited.

## Who approves [#who-approves]

The team lists the approvers on the plugin's page, under **Who approves what goes out**: one email per line, and how many approvals are needed. With nobody listed, admins approve. The person who asked for a draft never approves it.

Approvers can approve from the review queue, from a card in Slack or Teams, or from a link in an email.
