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

Periodic task run (cron) #80

Open
loopfz opened this issue Jan 23, 2020 · 1 comment
Open

Periodic task run (cron) #80

loopfz opened this issue Jan 23, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@loopfz
Copy link
Member

loopfz commented Jan 23, 2020

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

I'd like to be able to configure periodic execs for a given template + set of input.

Describe the solution you'd like
A clear and concise description of what you want to happen.

Periodic execs definition:

  • every X minute/hour/day
  • or everyday at 3pm
  • or every 3rd of each month at 2pm
  • or ...
    with template: create-new-thing-XXX
    with inputs:
    foo: yyy
    baz: xxxx
    bar: zzzz

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

@loopfz loopfz added the enhancement New feature or request label Jan 23, 2020
@iFrozenPhoenix
Copy link

iFrozenPhoenix commented May 28, 2021

@loopfz
A Cron job like experience can already be achieved with a task (http request to the http://localhost:8081/task) endpoint within the template to schedule the next execution. The parameters of the current execution can be passed through to the next schedule via go template syntax in the body of the request, e.g.

scheduleNextJobExecution:
    description: Schedule next job execution
    action:
      type: http
      configuration:
        url: http://localhost:8081/task
        method: POST
        body: '{"delay": {{ .input.delay }}, "input": {{ toJson .input }}, "template_name": "template-name" }'
    conditions:
    - type: skip
      if:
      - value: '{{ .input.enable_reschedule }}'
        operator: EQ
        expected: false
      then:
        this: DONE
      message: No rescheduling

The timer functionality e.g. hourly, can be achieved with a delay of "1h".
To achieve scheduling at a specific point in time e.g. "at 03:00 AM" the initial task have to be delayed to the desired point in time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants