Should I be seeing a flow produced in the cloud ui...
# prefect-getting-started
z
Should I be seeing a flow produced in the cloud ui for each run? using this block of code:
Copy code
deployment = Deployment.build_from_flow(
flow=artist_ranker_etl,
name="artist-ranker-deployment",
entrypoint="artist_ranker.main.handler",
)
deployment.apply()
I'm only seeing it once in the ui for the initial run.
r
it should, how are you triggering the run
z
The lambda is being trigger from another lambda currently. This the handler logic,
Copy code
def handler(event: dict, context: LambdaContext):
    """This function is the entry point for the Lambda function"""

    <http://log.info|log.info>("starting lambda function for artist ranking")

    <http://log.info|log.info>(f"event: {event},context: {context}")
    
    os.environ['PREFECT_HOME'] = '/tmp/prefect'


    start = time.time()

    # Case 2:
    deployment = Deployment.build_from_flow(
    flow=artist_ranker_etl,
    name="artist-ranker-deployment"    
    )
    deployment.apply()
    
    end = time.time()
    
    print(f"Time to execute: {end - start}")
r
thats deployment not invoking the flow
it will just be deploying over the top
z
hm, what am I missing to invoke the flow?
r
a schedule or a call to create a flow run
so a deployment has a flow, a flow has flow runs
z
So currently my cloud UI shows one flow run, but not any of the others. I'd image this script can invoke the flow when the lambda its in is triggered by another lambda. Is that true?
r
after deployment yes you can invoke it
z
hm, added this run_deployment(name="artist_ranker_staging/artist-ranker-deployment",tags=["staging","ranker"]) Several flow runs are being kicked off now for each lambda run, I was only expecting one. Nevertheless it doesn't seem like any of the tasks are being run.
@Taylor Curran