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

Keep provider should allow getting last workflow execution result #1028

Closed
talboren opened this issue Apr 1, 2024 · 1 comment · Fixed by #1029
Closed

Keep provider should allow getting last workflow execution result #1028

talboren opened this issue Apr 1, 2024 · 1 comment · Fixed by #1029
Labels
API API related issues Feature A new feature

Comments

@talboren
Copy link
Member

talboren commented Apr 1, 2024

So we can make the github-stars example work again (after removing the old state mechanism #1007).
Workflow should be able to get X last workflow executions and their results.

@talboren talboren added Feature A new feature API API related issues labels Apr 1, 2024
@talboren talboren linked a pull request Apr 2, 2024 that will close this issue
@talboren
Copy link
Member Author

talboren commented Apr 2, 2024

In #1029 I suggest a different approach where we add the last workflow execution to the context manager.
It might create "race" conditions if workflow interval is too often but I think it's good enough for now.

Workflow example:

id: new-github-stars
description: Notify Slack about new GitHub star for keephq/keep
triggers:
  - type: manual
  - type: interval
    value: 300
owners: []
services: []
steps:
  - name: get-github-stars
    provider:
      config: "{{ providers.github }}"
      type: github.stars
      with:
        previous_stars_count:
          default: 0
          key: "{{ last_workflow_results.get-github-stars.0.stars }}"
        repository: keephq/keep

Main difference is: key: "{{ last_workflow_results.get-github-stars.0.stars }}"

@shahargl lmk wdyt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API API related issues Feature A new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant