# 5.5 Create a workflow to control membership tags

{% embed url="<https://youtu.be/190HDqbt1y0>" %}

As we described earlier, when a membership with a tag is created, actually four tags are created including payment failure, suspension & cancellation tags. Let us check how we can set a **payment failure** tag when a payment during a subscription is failed.

In our workflow, we've two triggers. One trigger is for Successful Payment and another is for Payment Failure.

<figure><img src="/files/vHNZhMJ3xt26bxwm2W11" alt=""><figcaption></figcaption></figure>

Here a **Condition** is set for when the **Workflow Trigger** is either **Payment Success** or **Payment Failed.**&#x20;

<figure><img src="/files/1qdbkZx46FLocmruRbRV" alt=""><figcaption></figcaption></figure>

Suppose, a membership is created with a name **membership** & a tag **membership**. Hence, **membership\_payf**, **membership\_susp** & **membership\_canc** will also be created. When the payment is successful, we will add the **membership** tag & remove the three tags **membership\_payf**, **membership\_susp** & **membership\_canc.**

If the payment is failed, the **membership\_payf** tag will be added. This tag will remove access to the membership of that contact.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://better-wizard.gitbook.io/lead-connector-wizard/5.-membership/5.5-create-a-workflow-to-control-membership-tags.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
