Matthew Scanlon
03/11/2026, 4:37 PMMarvin
03/11/2026, 4:37 PMMarvin
03/11/2026, 4:41 PMfrom prefect import flow, task
import httpx
@task
async def om_post(base_url, token, path, payload):
async with httpx.AsyncClient() as client:
r = await <http://client.post|client.post>(
f"{base_url}{path}",
json=payload,
headers={"Authorization": f"Bearer {token}", "Content-Type": "application/json"},
timeout=60,
)
r.raise_for_status()
return r.json()
@flow
def sync_metadata():
return om_post(
base_url="<https://your-openmetadata>",
token="YOUR_TOKEN",
path="/api/v1/tables",
payload={"name": "processed_data", "fullyQualifiedName": "warehouse.schema.processed_data"},
)
Example (CLI via prefect-shell):
from prefect import flow
from prefect_shell import shell_run_command
@flow
def run_openmetadata_ingestion():
shell_run_command(
command="openmetadata ingest -c path/to/ingestion.yaml"
)
If OpenMetadata is what you’re targeting, happy to share a ready-to-run template—what entities or ingestion pipelines are you looking to orchestrate?