Kiran
10/09/2025, 6:43 AMMichal Barer
10/09/2025, 8:21 AMMomo Chimes
10/09/2025, 12:23 PMMomo Chimes
10/09/2025, 12:24 PMMomo Chimes
10/09/2025, 12:26 PMJared
10/09/2025, 4:04 PMMartin Janiczek
10/10/2025, 8:50 AMMarvin
10/10/2025, 1:16 PMMarvin
10/10/2025, 1:28 PMprefect api
para acessar o API diretamente. PR #19131
- Correções:
- Suporte ao parâmetro day_or
em cron schedules. PR #19121
- Outras correções em cancelamento assíncrono e serialização de bundles.
- Docs: exemplos e links de integrações atualizados (inclui exemplo de dashboard ATProto com Prefect Assets). PR #18984
Changelog completo: 3.4.22 → 3.4.23
Como usar as novidades
1) Cliente com SSL customizado
Em Prefect 3.x você pode passar um ssl.SSLContext
via httpx_settings
para o cliente:
import ssl
from prefect.client.orchestration import PrefectClient, SyncPrefectClient
# Crie/ajuste seu SSLContext (ex.: CA customizada)
ctx = ssl.create_default_context(cafile="/path/to/ca-bundle.pem")
ctx.minimum_version = ssl.TLSVersion.TLSv1_2
# Assíncrono
async with PrefectClient(
api="<https://api.prefect.cloud>",
api_key="YOUR_API_KEY",
httpx_settings={"verify": ctx},
) as client:
# faça chamadas via client.* ...
# Sincrono
with SyncPrefectClient(
api="<https://api.prefect.cloud>",
api_key="YOUR_API_KEY",
httpx_settings={"verify": ctx},
) as client:
# faça chamadas via client.* ...
Observações:
- httpx_settings["verify"]
aceita True/False
, caminho para CA bundle ou um ssl.SSLContext
(recomendado para controle fino).
- A assinatura de PrefectClient
confirma o parâmetro httpx_settings
.
2) Cron schedules com day_or
Confirmamos que prefect.schedules.Cron
expõe day_or: bool=True
. Use assim:
from prefect.schedules import Cron
# OR (padrão): dispara se dia-do-mês OU dia-da-semana bater
sched_or = Cron("0 9 * * MON,FRI", timezone="UTC", day_or=True)
# AND: dispara somente se ambos baterem (dia-do-mês E dia-da-semana)
sched_and = Cron("0 9 1 * MON", timezone="UTC", day_or=False)
Dica: se você precisa de day_or=False
, crie o Schedule explicitamente e passe no deploy:
from prefect import flow
from prefect.schedules import Cron
@flow
def my_flow():
...
schedule = Cron("0 9 1 * MON", day_or=False, timezone="UTC")
my_flow.deploy(
name="my-deployment",
schedule=schedule,
)
Docs gerais de schedules: Schedules
3) Sobre o novo comando prefect api
- Os release notes mencionam um novo comando prefect api
. No entanto, ao checar a ajuda local do CLI vimos “No such command 'api'”.
- Isso pode indicar que:
- sua instalação local ainda não está em 3.4.23, ou
- o comando está sendo gradualmente disponibilizado/ajustado.
- Por favor, confirme sua versão com:
prefect version
prefect --help
- Se precisar atualizar:
pip install -U prefect
Enquanto isso, você pode interagir com o API diretamente via Python:
import ssl, httpx
api_url = "<https://api.prefect.cloud/api>" # ajuste conforme necessário
api_key = "YOUR_API_KEY"
ctx = ssl.create_default_context(cafile="/path/to/ca-bundle.pem")
headers = {"Authorization": f"Bearer {api_key}"}
r = httpx.get(f"{api_url}/flows", headers=headers, verify=ctx)
r.raise_for_status()
print(r.json())
Quer que eu detalhe algum desses pontos (CLI, schedules ou segurança/SSL) em português mais a fundo? Também posso ajudar a aplicar isso no seu projeto atual.Lee Trout
10/10/2025, 2:38 PMVignesh GJ
10/12/2025, 3:53 PMMax
10/13/2025, 4:45 PMname: orchestrator
prefect-version: 3.4.22
build: null
push: null
pull:
- prefect.deployments.steps.set_working_directory:
directory: ./repositories
- prefect.deployments.steps.git_clone:
repository: <ssh://git@bitbucket.zzzxxxyyy/xxx/application-name.git>
branch: feature/prefect_xxx
deployments:
- name: application-name
version: 1.0.0
tags: [xxx]
description: xxx
schedule: {}
flow_name: null
entrypoint: application-name/xxx/script.py:foo
parameters: {}
work_pool:
name: application-pool
work_queue_name: null
job_variables: {}
Hello everyone, trying to understand what's the issue with my .yaml
.
The error I face is:
FileNotFoundError: [Errno 2] No such file or directory <entrypoint>
It looks like pull step is not even executed. I have my ssh configured properly and repo's pulled to my local with no issues.
I assume the solution is very simple and the question is very stupid and I am missing something 😄
@MarvinBrandon Robertson
10/13/2025, 6:38 PMfrom prefect.blocks.notifications import PagerDutyWebhook
pagerduty_webhook_block = PagerDutyWebhookBlock.load("my-pager-duty-block)
I'm getting this error:
File ".venv/lib/python3.13/site-packages/prefect/blocks/notifications.py", line 41, in __init__ NOTIFY_TYPES += (PREFECT_NOTIFY_TYPE_DEFAULT, ) # pyright: ignore[reportUnknownVariableType]
TypeError: unsupported operand type(s) for +=: 'frozenset' and 'tuple'
I'm using prefect version 3.4.0
Any suggestions?Steven Snowball
10/13/2025, 9:27 PMSerhiy
10/14/2025, 6:55 PMMehrdad
10/14/2025, 7:54 PMflow.from_source(
source=source_code_storage,
entrypoint=pricing_subflow_entrypoint
).deploy(
name=f'pricing-subflow-v2.0.1',
version=version,
work_pool_name=work_pool_name,
tags=["pricing-core"],
image=DockerImage(name=image, platform="linux/amd64"),
push=False,
build=False,
job_variables=job_variables
)
But the deployment name ends up being only "pricing-subflow-v2"
, and the rest of the name (.0.1
) gets ignored.
This is the result of deployment:Kiran
10/15/2025, 5:34 AMKiran
10/15/2025, 8:03 AMTomáš Řehák (realrehi)
10/15/2025, 12:08 PM{
"type": "compound",
"triggers": [
{
"type": "event",
"match": {},
"match_related": {
"prefect.resource.id": "prefect.deployment.<deployment A's id>"
},
"after": [],
"expect": [
"prefect.flow-run.Completed"
],
"for_each": [],
"posture": "Reactive",
"threshold": 1,
"within": 0
}
],
"require": "any",
"within": 0
}
And then in "Action" we picked "Run a Deployment" and selected Deployment B, also providing parameters.
However, when a Flow Run from Deployment A is Completed, nothing happens.
Is there something wrong about our trigger condition? Not sure what we are doing wrong. The ID provided is 100% correct.
Is it possible that the automation state is cached for a while when enabled / disabled? Because it was working before so maybe someone switched it off / on and it is still cached? Idk
Thanks for any helpHarshith Gogineni
10/15/2025, 12:51 PMcreate_flow_run_from_deployment()
What's happening:
• Deployment YAML has concurrency_limit: 13
and concurrency_limit: 7
configured
• ECS keeps spawning Fargate tasks without respecting limits
I have tried adding a concurrency limit on work pool instead of deployments but that is causing the runs to not even get into pending/running state they are stuck in late.
So ideally I need a solution where the concurrency limits are respected.Igor Kuzenkov
10/15/2025, 4:08 PMFlow A
.
Flow A
has two deployments - Deployment 1
and Deployment 2
.
My question
Is there a way to trigger Deployment 2
after Deployment 1
run reached any of Completed
or Failed
state?
What I tried
There is a template allowing me to create a trigger like When any flow run of flow Flow A enters Failed, Completed then do an action like Run a deployment Flow A -> Deployment 2.
But I don't need any here. I need Flow A -> Deployment 1 instead of any.
To summarize what I need.
Trigger:
When deployment run Flow A -> Deployment 1 enters Failed, Completed
Do action:
Run a deployment Flow A -> Deployment 2
Is my question applicable to the Prefect universe? If so, how to do this?
ThanksSergio Luceno
10/15/2025, 6:40 PM@flow
def hello():
time.sleep(300)
print("hello world")
I am packaging my flow into a python:3.11-slim, with just this code and pip installing prefect dependency, trying to keep things as minimum as possible.
We have a deployment that we set to use our docker image.
---
When executing this in our cluster, Everytime we run a deployment we get a new pod executing the flow.
Every pod takes 150-200MB of RAM (without counting the prefect-server + prefect-worker pods)
If I need to run for example 10K concurrent jobs, I will have 10K pods x 200Mb RAM each... => 2000000Mb RAM. It's something we can not afford.
Are we doing something wrong? Can we do our planned workload in another why it's gonna use less resources? We are starting to think prefect it's not for our use case:
We just want to run a bunch of small jobs, and benefit from prefect concurrency management, but we can not afford every single task has a starting memory footprint of 150-200MBNicholas Gaffney
10/16/2025, 3:58 AMASHIK
10/16/2025, 11:56 AMBen
10/16/2025, 2:45 PMentrypoint:
- /opt/prefect/entrypoint.sh
- prefect
- worker
- start
- '--pool=my-work-pool'
- '--with-healthcheck'
- '--name=${DEFAULT_WORKER_NAME}'
- '--limit=${DEFAULT_POOL_LIMIT}'
Solmaz Bagherpour
10/16/2025, 4:09 PMIhor Ramskyi
10/16/2025, 4:21 PMMatthew Bell
10/16/2025, 8:40 PMMatt Alhonte
10/17/2025, 2:20 AMOnishi Hideo
10/17/2025, 2:25 PM