putty
(putty)
28 أغسطس 2026، 8:16م
42
شكرًا، لقد حُلّت المشكلة!
3 إعجابات
Ethsim2
(Ethan )
29 أغسطس 2026، 1:59م
43
@gilles لقد نفّذت الآن المتابعة التي أشرتُ إليها أعلاه:
main ← Ethsim12:workflow-event-attendance
drafted 01:21PM - 29 Aug 26 UTC
Depends on #42932.
This is a stacked follow-up to #42932 adding `Set attendance… ` to the Event workflow action.
Until #42932 merges, GitHub's diff also contains the prerequisite Event action changes. Once #42932 is merged, this branch will be rebased onto the updated `main` so this PR contains only the attendance changes.
يضيف هذا تغييرًا عامًّا لعملية حدث → تعيين الحضور ، ويشمل:
المشارك (attendee)
حالة الحضور: سيحضر / مهتم / لن يحضر / إزالة الحضور
معرّف الموضوع (topic ID)
الفاعل (actor) اختياري
لذلك يمكن بناء حالتك الأصلية على النحو التالي:
تم إنشاء منشور → إذا كان أول منشور → حدث / تعيين الحضور
باستخدام كاتب الحدث كمشارك وتعيين حالته إلى سيحضر .
قمت باختبار هذا النمط تحديدًا محليًا في واجهة Workflows الرسومية، مع الاستناد إلى #42932، وتأكدت من أن المستخدم يُسجَّل تلقائيًا بحالة “سيحضر” في الحدث.
الحالي PR مسودة فقط لأنه يعتمد على #42932 . بمجرد دمج #42932، سأعيد تجميعه (rebase) على فرع main، مما سيترك فرقًا خاصًّا بالحضور فقط.
إعجابَين (2)
gilles
29 أغسطس 2026، 2:11م
44
@Ethsim2 شكراً لك، أنت رائع
إعجاب واحد (1)
putty
(putty)
31 أغسطس 2026، 5:44م
45
هل يوجد طريقة لإعادة محاولة تنفيذ سير عمل (نفس الحدث)، على غرار إعادة إرسال الحمولة في حالة استخدام Webhook؟
j.jaffeux
(Joffrey Jaffeux)
31 أغسطس 2026، 7:51م
46
لا، نعتذر، نحن لا ندعم هذا حاليًا.
إعجابَين (2)
joo
(slower)
1 سبتمبر 2026، 6:04ص
47
هل يوجد مُشغِّل/حدث يُطلق عند إنشاء وسم جديد؟
عندما يُنشئ مستخدم وسمًا جديدًا، هل هناك طريقة لإضافته تلقائيًا إلى مجموعة وسوم محددة؟ وإذا لم يكن الأمر كذلك، فما هو النهج الموصى به؟
إعجاب واحد (1)
j.jaffeux
(Joffrey Jaffeux)
1 سبتمبر 2026، 12:23م
48
لا، لا نملك أيًا من هذه الأشياء. هل يمكنك توضيح حالتك الاستخدامية بشكل أكبر من فضلك؟
RGJ
(Richard - Communiteq)
1 سبتمبر 2026، 3:06م
50
يوجد حدث “تغيير وسم الموضوع”. يمكنك بعد ذلك استدعاء واجهة برمجة تطبيقات Discourse للتحقق من عدد المرات التي يُستخدم فيها الوسم. إذا كان مرة واحدة / إذا كان على ذلك الموضوع المحدد، فستعرف أن الوسم جديد.
بديلًا لذلك، وربما يكون أسهل: يمكنك إعداد خطاف ويب (webhook) لحدث “إنشاء وسم” وتوجيهه إلى مُشغِّل خطاف ويب في سير العمل.
إعجاب واحد (1)
joo
(slower)
2 سبتمبر 2026، 2:57ص
51
حالة الاستخدام: لدي مجموعة وسوم باسم “فنان”. يظهر فنانون جدد باستمرار، لذا تظهر وسوم فنانين جدد باستمرار عندما ينشئها المستخدمون. أريد أن تُضاف هذه الوسوم الجديدة تلقائيًا إلى مجموعة الوسوم “فنان”، بدلاً من أن أضيفها يدويًا. هل هناك طريقة جيدة لتحقيق هذا النتيجة باستخدام سير عمل (Workflows)؟
j.jaffeux
(Joffrey Jaffeux)
2 سبتمبر 2026، 6:47ص
52
كيف تعرف أنه وسم فنان وليس مجرد وسم عشوائي آخر؟
joo
(slower)
2 سبتمبر 2026، 7:35ص
53
هذا بالضبط ما تعالجه خطوة الذكاء الاصطناعي. يقوم وكيل الذكاء الاصطناعي أولاً بتحديد ما إذا كان الوسم الجديد ينتمي إلى أيٍّ من المجموعات المحددة (الموسيقي / العضو / المنطقة / نوع الحدث / نوع الإصدار)؛ وإذا لم ينطبق على أيٍّ منها، يتم تجاهله ولا يُصنَّف ضمن أي مجموعة. وبالتالي، يتم تصفية الوسوم العشوائية، ولا يُضاف تلقائيًا إلى مجموعة الوسوم سوى الوسوم المصنّفة بشكل صحيح.
إعجاب واحد (1)
j.jaffeux
(Joffrey Jaffeux)
2 سبتمبر 2026، 8:58ص
54
حسنًا، سأضيف بعض المحفّزات (triggers) عند إنشاء وسم (tag)، بالإضافة إلى عقدة (node) لإضافة الوسم إلى مجموعة الوسوم (tag group).
4 إعجابات
j.jaffeux
(Joffrey Jaffeux)
2 سبتمبر 2026، 2:41م
55
لقد أضفنا ما يلي إلى سير العمل:
committed 02:40PM - 02 Sep 26 UTC
Add the `action:tag_group` workflow node for adding and removing tags.
committed 01:19PM - 02 Sep 26 UTC
Add a `tag_created` workflow trigger with serialized tag payloads.
committed 10:09AM - 02 Sep 26 UTC
Previously, the events plugin had no way to drive a workflow from an
RSVP or fro… m an event finishing, and a trigger node contributed by any
plugin was added to the registry but never subscribed to its
`DiscourseEvent` — so it saved fine, showed up in the palette, and
silently never fired.
This change wires the subscription into node registration, which drops
the hand-rolled `on(...)` workarounds in assign, topic voting and chat,
and adds `trigger:event_participation_changed` and
`trigger:event_ended`, both scopable to a single topic.
---
Split into two commits, since the first touches shared infrastructure:
- **`FIX: Subscribe trigger events for workflow nodes added by
plugins`** — claiming a node now registers *and* subscribes it, and
contributing plugins are flushed before the host claims its own, so
ownership lands on them. Because the subscription goes through
`Plugin::Instance#on`, a node stops listening while *its own* plugin is
disabled rather than following the host's setting. This also drops a
duplicate registration that let `trigger:chat_message_created` show in
the palette while chat was disabled.
- **`FEATURE: Workflow triggers for event participation and event end`**
— the two triggers. No `on(...)` wiring needed in the events plugin
thanks to the commit above.
Three behaviour changes in the events plugin, each deliberate:
- Withdrawing an RSVP destroyed the record without publishing anything,
so attendance state built from these triggers could never recover from
someone leaving. Removal now publishes, and reads as `status: null` with
`removed: true`. The livestream chat sync skips removals, so its
follow/unfollow behaviour is unchanged.
- The ended occurrence travels with `:discourse_post_event_event_ended`.
`set_next_date` moves the event on immediately afterwards, and
`Event#starts_at` returns `nil` once a bounded series is past
`recurrence_until`, so the event alone cannot say which occurrence
ended.
- Re-submitting an unchanged RSVP still publishes, so the trigger
ignores it rather than running a workflow twice for one decision.
Payload is `{event, post, topic, stats}`, plus `{user, participation}`
on the participation trigger — modelled on
`WebHook.build_calendar_event_payload` rather than `EventSerializer`,
which goes admin-truthy under a system guardian. No JS, no core changes,
no new site settings.
### Known gaps, documented rather than fixed
Bulk invite, `Event#create_invitees` (`insert_all!`),
`reset_invitee_notifications` (`update_all`),
`enforce_private_invitees!` (`delete_all`) and event/user destroy stay
silent. `create_attendance!` swallows `RecordNotUnique`, so a concurrent
first RSVP fires nothing. `event_ended` can re-fire if an edit resets
`finished_at`, and is missed when an event is closed early:
`EventDate.pending` merges `Event.open`, so the in-flight occurrence
leaves the job's scope.
`EventListener` does not rescue `new`/`valid?`/`matches?` and
`DiscourseEvent.trigger` re-raises, so a raising subscriber aborts
`MonitorEventDates` mid-`find_each`. Adding `continue_on_error:` there
breaks existing `track_events` assertions, so it is left for its own
commit.
### Testing
Full `discourse-workflows` and `discourse-events` backend suites pass
(4005 examples), plus the workflow specs in chat, assign and topic
voting. Verified at runtime that all 22 trigger nodes have exactly one
subscription and there are no duplicate registrations, and that both new
nodes disappear from the palette and stop dispatching when
`discourse_events_enabled` is off.
Meta:
https://meta.discourse.org/t/discourse-calendar-events-webhook-triggers-automations-plugin/409623
---------
Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
4 إعجابات