# Delete Attachment

Use a Delete Attachment node in your Flow to remove a specific attachment from a record by its ID. To configure a Delete Attachment node in the Flow Editor, drag it from the Palette to the Workspace canvas, then double-click the node to open and configure its behavior.

{% stepper %}
{% step %}

### Provide an optional **Name** for the node.

By default a Delete Attachment node will be shown with a label of "delete attachment", but the value you provide in the Name field will replace it in the Flow Editor UI making your flow easier to read and understand.
{% endstep %}

{% step %}

### Select a **Type Id** for the node — the Object Type that has Records with which you want to use attachments, specified using one of several options.

* *type* - choose this option for a dropdown that includes the Display Names of the Object Types you have created in your Contextual tenant.
* *string* - choose the string option, and type in a string for the Object Type ID, using *type* is recommended instead of string
* *msg.* - choose this option to specify a path in the msg. object that contains the Object Type ID value
* *env variable* - Environmental Variables are a feature of Agents in Contextual. Any Environmental Variables that you define as Label/Value pairs for an Agent that is sending events to a Flow, will be available to the Flow, simply type the Label of the Environmental Variable from which you want to use the value.
  {% endstep %}

{% step %}

### Specify the **Attachment Id** of the attachment you want to delete.

* Use *string* or *msg.*
* When the attachment ID comes from a URL path parameter, this is typically `msg.req.params.id`
  {% endstep %}

{% step %}

### Optionally specify an **If Hash Match** value for concurrency control.

* When provided, the attachment will only be deleted if its current content hash matches the supplied value — useful for ensuring you are deleting the exact version of an attachment you last read, and not one that has since been replaced
* Leave empty to delete unconditionally
  {% endstep %}

{% step %}

### Specify the **Response Property** msg. object path to store the operation response, e.g. `msg._response`.

{% endstep %}
{% endstepper %}

When the Delete Attachment node is included in the path of your flow, it will delete the specified attachment if it exists.
