<@ULVA73B9P> In prefect v2, the tags are propagate...
# ask-community
m
@Marvin In prefect v2, the tags are propagated from the task definition using task customization as below. How to implement this in prefect V3?
Copy code
{
  "op": "add",
  "path": "/propagateTags",
  "value": "TASK_DEFINITION"
}
m
In Prefect 3.x, tags can be used to manage task execution, particularly for concurrency limits. However, the specific feature of propagating tags from a task definition as seen in Prefect 2.x isn't directly mentioned in the available documentation for Prefect 3.x. To implement a similar behavior in Prefect 3.x, you can use tags for task concurrency and manage them at the flow or task level. Tags can be set directly on tasks when defining them, and they can be used to control task execution by setting concurrency limits. Here's a simple example of how to add tags to a task in Prefect 3.x:
Copy code
python
from prefect import task, flow

@task(tags=["example-tag"])
def my_task():
    print("Task with a tag")

@flow
def my_flow():
    my_task()

my_flow()
This example demonstrates how to assign a tag to a task, which can be useful for concurrency management or organization. For more details, you can refer to the Prefect 3.x documentation on task run limits. If you need to propagate tags in a specific way, you might need to manually handle this within your flow logic.
m
@Nate @Bianca Hoch Can you please help me on this?
For context, we didn't use tags in prefect V2 but we used to propogate them from the task definition tags. We need similar behavior in V3
n
hi @Mohan kancherla - please refrain from tagging prefect employees if they didn't start the conversation
propagated from the task definition using task customization as below
its not clear from your question what you're referring to, are you talking about ECS tasks? prefect tasks? either way, the behavior should be nearly the same between 2.x and 3.x
m
Sorry for tagging but Marvin response was not helpful. In V2, we used ECS task blocks and used task customization field to assign security group, subnet and use the tags of ecs task definition for the prefect flows. In V3, we are using ECS work pool and in which, we have network configuration optional field for adding security group and subnets but didn't see a field of task customization to provide extra parameters like propagate tags.
These are the tags on the ecs task while running but we also need tags from the task definition as well. This was achieved in V2 using propogateTags field but do not see an option in V3.
Never mind, the addition of propagateTask field in the task_run_request worked.