ivy: flow/v1
name: Two checks at the same time
description: When a file arrives, two checks run at the same time, then one summary is posted.

on:
  file: { folder: Inbox, events: [created] } # the folder to watch

steps:
  - id: check_format
    name: Check the format
    code: checks/format.py # a code file of this space
    files: ["{{ trigger.file }}"]
  - id: check_content
    name: Check the content
    after: start
    agent: ivy
    prompt: Check this file for missing or contradictory information.
    files: ["{{ trigger.file }}"]
    output:
      schema: { type: object, required: [text], properties: { text: { type: string } } }
  - id: summary
    name: Post the results
    after: [check_format, check_content]
    post:
      to: { channel: General }
      text: "Both checks are done: {{ steps.check_content.output.text }}"
