# ...

@inngest_client.create_function(
    fn_id="import-product-images",
    trigger=inngest.TriggerEvent(event="shop/product.imported"),
    middleware=[
        DbSetupMiddleware, # This is executed third
        DatadogMiddleware # This is executed fourth
    ],
)
async def fn(ctx: inngest.Context):
    # ...

```
</CodeGroup>

Learn more about the Middleware hooks and their execution order in ["Creating a Middleware"](/docs/features/middleware/create).