Files
osmedeus/test/testdata/workflows/events/dedupe-receiver.yaml
T
j3ssie 777fb7c2bf chore: update ui build artifacts and refactor event trigger input syntax
- Update Next.js build IDs and chunk hashes in workflow upload static files
- Replace deprecated 'input' field syntax with new exports-style variables in event triggers (e.g., 'Target: event_data.value' instead of type/field/name)
- Simplify parameter override syntax in test workflows (remove nested 'default' structure)
2026-01-24 16:24:50 +08:00

49 lines
1.2 KiB
YAML

# Deduplicated Event Receiver Workflow
# This workflow demonstrates event deduplication to prevent processing duplicates
name: dedupe-receiver
kind: module
description: Workflow with event deduplication to avoid processing duplicates
tags: event,receiver,dedupe,example
triggers:
# Deduplicate events by URL within a 5 minute window
- name: on-new-url-dedupe
on: event
event:
topic: "crawler.url"
filters:
- "event.data_type == 'url'"
dedupe_key: "{{event.data.url}}"
dedupe_window: "5m"
enabled: true
# Deduplicate by composite key (source + target)
- name: on-asset-composite-dedupe
on: event
event:
topic: "discovery.asset"
dedupe_key: "{{event.source}}-{{event.data.value}}"
dedupe_window: "1h"
enabled: true
params:
- name: target
required: true
steps:
- name: log-unique
type: function
functions:
- 'print_blue("Processing unique event for: {{target}}")'
- name: process-unique
type: bash
command: |
echo "Unique target: {{target}}"
echo "{{target}}" >> {{Output}}/unique-targets.txt
- name: log-done
type: function
functions:
- 'print_green("Processed unique: {{target}}")'