You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! I'm new to Prefect and I was wondering how to instantiate runs with different contents for the parameters specified in the flow.
For instance, the sample code from the readme:
fromprefectimportflow, taskfromtypingimportListimporthttpx@task(log_prints=True)defget_stars(repo: str):
url=f"https://api.github.com/repos/{repo}"count=httpx.get(url).json()["stargazers_count"]
print(f"{repo} has {count} stars!")
@flow(name="GitHub Stars")defgithub_stars(repos: List[str]):
forrepoinrepos:
get_stars(repo)
# run the flow!if__name__=="__main__":
github_stars(["PrefectHQ/Prefect"])
Runs the flow passing the list hardcoded. Is there best practice to set that as an argument, to be populated on a manual run from the UI, or, trigger the flow execution via the API (and passing down the argument content as part of the call body)?
Edit #1
I noticed in the docs the Deployments do specify something about parameters:
parameters: default values of flow parameters that this deployment will pass on each run. These can be overwritten through a trigger or when manually creating a custom run.
How can such manual run be triggered via the API with the custom parameter content?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi! I'm new to Prefect and I was wondering how to instantiate runs with different contents for the parameters specified in the flow.
For instance, the sample code from the readme:
Runs the flow passing the list hardcoded. Is there best practice to set that as an argument, to be populated on a manual run from the UI, or, trigger the flow execution via the API (and passing down the argument content as part of the call body)?
Edit #1
I noticed in the docs the Deployments do specify something about parameters:
parameters: default values of flow parameters that this deployment will pass on each run. These can be overwritten through a trigger or when manually creating a custom run.
How can such manual run be triggered via the API with the custom parameter content?
Beta Was this translation helpful? Give feedback.
All reactions