Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Idea: core.inject_trigger #4231

Closed
cognifloyd opened this issue Jul 9, 2018 · 1 comment
Closed

Feature Idea: core.inject_trigger #4231

cognifloyd opened this issue Jul 9, 2018 · 1 comment
Assignees
Labels
Milestone

Comments

@cognifloyd
Copy link
Member

SUMMARY

I would like to inject/dispatch triggers in the middle of workflows so that rules can trigger additional workflows when those trigger points are reached. Then, custom triggers registered in a pack can serve as well known synchronization points.

ISSUE TYPE
  • Feature Idea
EXPECTED RESULTS

trigger my_42_trigger registered in example pack with the following action in a workflow to dispatch it.

dispatch_action_in_workflow:
  action: core.inject_trigger
  input:
    trigger: example.my_42_trigger
    parameters:
      answer_to: "{{ task('life').result.stdout }}"
      the_universe: "{{ _.and_everything }}"

EXAMPLE USE CASE

I have a data-processing workflow that gets triggered by a sensor when a new server comes online. The workflow gathers data about the server, processes it (using custom actions), and then dispatches/injects the additional triggers once each piece of data is available. This way, the sub-workflows can start as soon as the data they require is available, and the data-processing workflow can be much simpler without having to keep a centralized list of everything that should start once the data is ready.

IMPLEMENTATION THOUGHTS

This could be, as @nmaludy suggested in slack, an action that uses webhooks to kick off the various triggers/workflows.

If the action were in core, however, it could skip the webhook processing, and just inject the trigger. This might work something like the sensor service's dispatch method.

I looked at putting this in the st2 pack, but the st2 client lib doesn't have the ability to kick off triggers, so it makes more sense to make this part of the core pack. Possible names include core.inject_trigger or core.dispatch_trigger. "dispatch" is nice because it mirrors the terminology used in sensors.

Looking at what might be useful in implementing this:

@Kami
Copy link
Member

Kami commented Jul 23, 2018

#4259 should resolve this.

Here is also some more context and details - https://forum.stackstorm.com/t/is-there-a-way-to-trigger-event-in-workflow-like-inquiry-and-consume-it-in-rules/199 (in short, multiple people have already asked about such feature in the past).

@Kami Kami closed this as completed in #4259 Aug 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants