Hello everyone , I am running my prefect on K8 clu...
# prefect-server
a
Hello everyone , I am running my prefect on K8 cluster using helm charts. I have a separate postgres stateful database attached to persist states. I have 2 questions here :
Copy code
1.) I have flow which gets data from an api and i want to publish it to slack directly, how should i do it without writing it anywhere. 
2.) If i want to save my flow/task results on a machine from where I am registering my flows despite flow running on pods on k8 ,how should i do it.
z
Hi @ash! For (1), I would recommend creating a task that takes the data from your api and publishes it to Slack For (2) I'd take a look at Results https://docs.prefect.io/api/latest/engine/results.html#prefectresult. If nothing fits your use case, you can write custom logic in tasks/flows to write results to the desired location
a
@Zach Angell thank you for the response. 1.) how shall i access the value in task output for ex my flow is this and i want to see value of df_web, since its a prefect task it now contains states and is not behaving like a functional output.
Copy code
with Flow("funnnel_1", state_handlers=[flow_failed_alert]) as f:
    df_train = train_app_funnel()
    df_flight = brand_app_funnel()
    df_web = web_app_funnel()
    out = creating_final(df_train,df_flight,df_web)
z
Before returning output of
create_final
, you should be able to publish it to Slack
a
ohh ok got it. Is there a way i can retrieve it from the out variable?
z
You could pass it into another task
Copy code
with Flow("funnnel_1", state_handlers=[flow_failed_alert]) as f:
    df_train = train_app_funnel()
    df_flight = brand_app_funnel()
    df_web = web_app_funnel()
    out = creating_final(df_train,df_flight,df_web)
    post_to_slack(out) # new task `post_to_slack` takes in `out` and posts it to slack