---
title: "Expiry dates use in macros"
canonical: "https://support.appfire.com/space/CDML/649925358/Expiry%20dates%20use%20in%20macros"
format: markdown
---
## Overview

> Macro (aura-html)


This article describes how [Expiry Dates](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649890606) interact with specific macros

## [state](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649531575)

The expiry date for a workflow state is set via the `duedate` parameter.

The `duedate` parameter accepts both date and duration formats, as well as [Value References](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649694302).

> Macro (excerpt-include)



The `duedate` for a state is set on the transition into the state. The time period to expiry is displayed in the workflow popup for the state.

![cdm-wfpopup_approved_state_2days.png](media://19447254-bbc0-4bcb-aab6-4edf9331acf1)

Upon expiry of the `duedate` fixed date or duration period

- the expiry indicator in the workflow popup turns red

![cdm-wfpopup_approved_state.png](media://821d21f2-c9cf-4ed0-b9fb-6f2f79fe2756)

> ℹ️ See: [State expiry date](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649693610)

If the expiry date occurs whilst the page or blog post is in the state (not before, not after):

- the `stateexpired` event is sent

If the expiring state has an `expired` parameter, the workflow transitions to the state specified in the `expired` parameter.

On the `expired` parameter, the following workflow events are sent

- `statechanged`
- `pagestatechanged` *if the event occurred for a workflow applied to a page*
- `newstatechanged` *if the event occurred for a workflow applied to a blog post*

> ℹ️ Watchers and participants receive a notification

If the expiry date is set as a date that is before the occurrence of the transition to the state

- the state shows as expired but does not trigger any events or transition to another state

> ✅ This is good reason to use duration periods for `duedate` values rather than a fixed date.

### Examples

> Macro (contentbylabel)

## [set-state-expiry](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649563686)

This macro can be used during an event (including expiry events) to set a new expiry date for a state.

It accepts both date and duration formats, as well as [Value References](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649694302).

### Examples

> Macro (contentbylabel)

## [task](https://appfire.atlassian.net/wiki/spaces/CDML/pages/650315819)

The expiry date for a task is set via the `duedate` parameter, which accepts both date and duration formats, as well as [Value References](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649694302).

Upon expiry

- the expiry date and time is displayed in the tasks popup
- If the expiry date occurs whilst the state is active (not before, not after):
  - the `taskexpired` event is sent

The expiry of the task event is displayed in the document activity report for the page.

![cdm_dareport_taskexpiry_extract.png](media://4a4fc069-c166-4e4e-bc50-843efdd25b38)

If the state in which the expiring task has a `taskcompleted` parameter, the workflow transitions to the state the `taskcompleted` parameter specifies

On the `taskcompleted` parameter transition, the following events are sent

- `statechanged`
- `pagestatechanged` *if the event occurred for a workflow applied to a page*
- `newstatechanged` *if the event occurred for a workflow applied to a blog post*

> ℹ️ Watchers and participants receive a notification

### Examples

> Macro (contentbylabel)

## [set-message](https://appfire.atlassian.net/wiki/spaces/CDML/pages/650153597)

When a [set-message](https://appfire.atlassian.net/wiki/spaces/CDML/pages/650153597) macro in a trigger has a `duedate` parameter value and this expires

- the message is removed

### Examples

> Macro (contentbylabel)

## [workflowparameter](https://appfire.atlassian.net/wiki/spaces/CDML/pages/650348884)

This macro creates editable [Value References](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649694302) which, depending on its `edit` parameter setting, can be edited by space admins or users:

- [Parameters - Space Tools](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649726501)
- [Workflow setup](https://appfire.atlassian.net/wiki/spaces/CDML/pages/650216852) - [Workflow Popup](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649659846)

Be sure to specify the `type` as duration.

> 📝 The resulting editable field usually requires an exact date to be input.

Examples:

> Macro (contentbylabel)

  


| **[‹ Back to Expiry Dates](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649890606)** |
| --- |