jaikit-flows
Login

gmail_inbox_zero — Gmail inbox zero — classifier + actions auto

sha=6c4440a1c6bc · visibility=admin · tags=gmail, llm, hourly
🚫 Workflow bloqué — composants manquants (11)

Le bouton "Run now" est désactivé tant que ces erreurs ne sont pas résolues.

id: gmail_inbox_zero
name: Gmail inbox zero — classifier + actions auto
description: |
  Toutes les 30 min : récupère les non-lus, classifie via Groq,
  applique labels/archive/trash, alerte si critique. HITL si confidence < 0.7.

owner: admin
visibility: admin
tags: [gmail, llm, hourly]

triggers:
  - type: interval
    every: 30m

inputs: {}
env: {}

steps:

  - id: list_unread
    node: gmail.list_inbox
    with:
      query: "is:unread"
      max: 50

  - id: classify_each
    node: llm.classify
    foreach: ${{ steps.list_unread.outputs.messages }}
    with:
      text: "Sujet: ${{ each.subject }}\nExpéditeur: ${{ each.from }}\nAperçu: ${{ each.snippet }}"
      classes: [critical, important, newsletter, spam, deja_traite]
    on_low_confidence:
      hitl_gate:
        title: "Classement email incertain"
        notify: telegram
        timeout_minutes: 720
        on_timeout: skip

  - id: label_each
    node: gmail.label
    foreach: ${{ steps.classify_each.outputs }}
    with:
      message_id: ${{ each.label }}
      add_labels: [INBOX]
      remove_labels: []

  - id: alert_critical
    node: notif.telegram
    if: ${{ steps.classify_each.outputs | length }}
    with:
      message: "🚨 Inbox zero run ${{ run.id }} — ${{ steps.list_unread.outputs.messages | length }} mails traités."

on_failure:
  - id: notify_fail
    node: notif.telegram
    with:
      message: "❌ gmail_inbox_zero a échoué — run ${{ run.id }}"