Guides

Morning brief to Slack

Somebody reads the overnight noise every morning and tells everyone else what matters. It takes forty minutes and it's the same forty minutes on Monday as on Thursday.

This guide moves that job to an agent and puts the result in Slack at 7am, so the first person in reads the brief instead of writing it.

It's the natural second thing to build. The quickstart gets Scout writing a decent brief. This adds the Slack step so nobody has to open Mobius to read it.

What you'll build

  • A schedule that fires at 7:00 on weekdays.
  • One agent step where Scout writes the brief.
  • One action step that posts it to #service-desk.

Twenty minutes, assuming Scout already exists.

Before you start

  • Slack connected under Library > Integrations, with the bot able to post to your channel. Ours is #service-desk.
  • An agent named Scout (agt_scout). The quickstart creates one.
  • Permission to run Slack actions in this project.

Get the brief right first

Before you touch Slack: run the agent step on its own a few times and read the output.

This is worth doing properly, because a brief nobody reads is worse than no brief. Ask yourself, honestly, whether you'd read this at 7am. Usually the first version is too long and too hedged. Tell Scout to be shorter and more definite, and try again.

Only once you'd actually read it should you put it in a channel.

Build it

  1. Open Build > Loops.
  2. Create a loop named Morning brief.
  3. Add a Schedule trigger, weekdays at 07:00.
  4. Add an agent step and select Scout.
  5. Ask for a short brief: what happened overnight, what to watch, and the next three things to pick up.
  6. Add an action step and choose slack.message.post.
  7. Set the channel to #service-desk.
  8. Set the message to the brief from the previous step.
  9. Save the loop as active.

The job now runs on the schedule, and you can still hit Run yourself any time, which is how you'll reproduce a brief after fixing something.

The finished job

schema_version: "1"
name: morning-brief
description: Write the overnight brief and post it to the service desk channel.
concurrency: queue
limits:
  budget_usd: 1
  wall_clock_timeout: 15m
triggers:
  - key: weekday-brief
    name: Weekday brief
    kind: schedule
    enabled: true
    config:
      cron: "0 7 * * MON-FRI"
      timezone: "America/New_York"
steps:
  - id: write-brief
    name: Write brief
    kind: agent
    config:
      agent_id: agt_scout
      instructions: |
        Write this morning's brief for the Northwind IT service desk. Cover
        what came in overnight, anything worth watching today, and the next
        three things somebody should pick up. Markdown, under 200 words.
  - id: post-to-slack
    name: Post to Slack
    kind: action
    config:
      action_name: slack.message.post
      parameters:
        channel: "#service-desk"
        text: "${{ steps.write-brief.output }}"

Run it

Click Run on the loop page. A run that worked looks like this:

run.started
step.started     step=write-brief kind=agent
step.completed   step=write-brief
step.started     step=post-to-slack kind=action
action.called    action_name=slack.message.post
action.completed action_name=slack.message.post
step.completed   step=post-to-slack
run.completed

The Slack action hands back the channel and the message timestamp, so you can prove it posted:

{
  "write-brief": "## Northwind service desk brief - Monday 9 Jun\n...",
  "post-to-slack": {
    "channel": "C0123DESK",
    "timestamp": "1781190000.000100"
  }
}

If the run failed: almost always Slack. Check that the integration is connected and that the bot has been invited to the channel. The action error on the Timeline tab shows exactly what Slack said, which is faster than guessing.

Variations

Keep it out of Slack at first. Skip the action step and read the brief on the run page for a week. Add Slack once the wording is right, so your team's first impression isn't a bad draft.

Let Slack do the scheduling. Use slack.message.schedule if you'd rather generate the brief earlier and have Slack post it at 7am.

Add real data. Put an action step before the agent step to pull in whatever the brief should cover: alerts, ticket counts, a spreadsheet of backup results. The agent writes better when it's summarizing something specific rather than speaking generally.

Get it approved first. For a brief that goes to a client rather than your own team, add an interaction step between writing and posting.

One per client. Duplicate the job in each client's project, pointing at that client's channel.

Next