Package io.kestra.core.tasks.executions
Class Counts
java.lang.Object
io.kestra.core.models.tasks.Task
io.kestra.core.tasks.executions.Counts
- All Implemented Interfaces:
RunnableTask<Counts.Output>
@Plugin(examples=@Example(title="Send a slack notification if no execution for a flow on the last 24h",full=true,code={"id: executions-count","namespace: io.kestra.tests","","tasks:"," - id: counts"," type: io.kestra.core.tasks.executions.Counts"," expression: \"{{ count == 0 }}\""," flows:"," - namespace: io.kestra.tests"," flowId: logs"," startDate: \"{{ now() | dateAdd(-1, \'DAYS\') }}\""," - id: each_parallel"," type: io.kestra.core.tasks.flows.EachParallel"," tasks:"," - id: slack_incoming_webhook"," type: io.kestra.plugin.notifications.slack.SlackIncomingWebhook"," payload: |"," {"," \"channel\": \"#run-channel\","," \"text\": \":warning: Flow `{{ jq taskrun.value \'.namespace\' true }}`.`{{ jq taskrun.value \'.flowId\' true }}` has no execution on last 24h !\""," }"," url: \"https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX\""," value: \"{{ jq outputs.counts.results \'. | select(. != null) | .[]\' }}\"","","triggers:"," - id: schedule"," type: io.kestra.core.models.triggers.types.Schedule"," backfill: {}"," cron: \"0 4 * * * \""}))
public class Counts
extends Task
implements RunnableTask<Counts.Output>
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected @NotNull Stringprotected @NotNull Stringprotected List<State.Type> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionrun(RunContext runContext) Thsis method is called inside the Worker to run (execute) the task.Methods inherited from class io.kestra.core.models.tasks.Task
findById, findById, isFlowable, isSendToWorkerTask
-
Field Details
-
flows
-
states
-
startDate
-
endDate
-
expression
-
-
Constructor Details
-
Counts
public Counts()
-
-
Method Details
-
run
Description copied from interface:RunnableTaskThsis method is called inside the Worker to run (execute) the task.- Specified by:
runin interfaceRunnableTask<Counts.Output>- Throws:
Exception
-