24 lines
576 B
Python
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()}")
|