Thread
#random
    Apoorva Desai

    Apoorva Desai

    6 months ago
    Hello, I am trying to run a prefect flow triggered by when there is a change in a github repository that is NOT the repo that the prefect flow lives in. TLDR: pull request on repository A triggers prefect flow living in Repository B. This is the closest I've come to figuring this out: https://docs.prefect.io/core/pins/pin-08-listener-flows.html Has anyone done this before or have instructions?
    Kevin Kho

    Kevin Kho

    6 months ago
    Hi @Apoorva Desai, our paradigm around this is triggering the Flow like this. You can hit the Prefect API with
    Client.create_flow_run
    or the
    create_flow_run
    task
    Or you can even use a Python request
    Anna Geller

    Anna Geller

    6 months ago
    could you explain the problem that you try to solve a bit more? if you would like to just execute code from another repository, you could use pygit2:
    @task(name="Clone DBT repo")
    def pull_dbt_repo(repo_url: str, branch: str = None):
        pygit2.clone_repository(url=repo_url, path=DBT_PROJECT, checkout_branch=branch)
    but if you are trying to build a CI/CD pipeline, you would usually register a flow on merge to e.g. master branch rather than triggering a flow
    Apoorva Desai

    Apoorva Desai

    6 months ago
    Thank you!