To create a new workflow follow these steps:
-
Create a new folder in the
workflowsdirectory. -
Add a
README.mdfile to the new folder. This file should contain a description of the workflow. -
Add an
__init__.pyfile to the new folder. This file should export a function calledrunwith the following signature:def run(vars:dict=None, secrets:dict=None, config_file:str=None) -> Integer.
To test your workflow locally follow the below steps (check the example repository for more details):
- Create a new folder.
- Create a
pyproject.tomlusingpoetry init. - Update the
pyproject.tomlnamespace to "firestarter":[tool.poetry] name = "firestarter"
- Create the folder
/firestarter/workflowsand add your workflow folder inside. - Execute the workflow using
poetry run firestarter local(usepoetry run firestarter -hfor more details).
To make changes in the cli and test it locally you need to update the pyproject.toml to update the dependencies.
This can be done in the following ways:
- Use a git branch instead of main (docs):
[tool.poetry.dependencies] python = "^3.11" firestarter-workflows = {git = "https://github.com/prefapp/firestarter-workflows", branch = "fix/new-bug"}
- Use the local directory files (docs):
[tool.poetry.dependencies] python = "^3.11" firestarter-workflows = {path = "../firestarter-workflows"}
Remember to update the dependencies when doing so (
poetry update firestarter-workflows).