knoc-plugin-template/src/knoc_plugin_template/workflows.py
phil 7c129cc81b
All checks were successful
/ build (push) Successful in 5s
Inital commit
2025-05-28 17:36:06 +02:00

24 lines
576 B
Python

from datetime import datetime
from pydantic import BaseModel
from hatchet_sdk import Context, EmptyModel
from knoc_plugin_template import __version__
from knoc.settings import settings
from knoc.hatchet_client import hatchet
class SimpleOutput(BaseModel):
message: str
do_nothing_wf = hatchet.workflow(
name="Do-nothing-wf",
version=__version__,
)
@do_nothing_wf.task()
async def do_nothing(input: EmptyModel, ctx: Context) -> SimpleOutput:
ctx.log("Just a workflow template")
return SimpleOutput(message=f"Foo v{__version__} at {datetime.now()}")