> ## Documentation Index
> Fetch the complete documentation index at: https://docs.royaltyport.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Contract Renewal Pipeline

> Detect expiring contracts, generate renewal briefs, and create tickets in your project management tool

When a contract's term end date is approaching, business affairs needs to prepare renewals proactively. This automation runs weekly, identifies expiring contracts that haven't been flagged yet, generates renewal briefs, creates tickets in a project management tool, and notifies the team — while tracking which contracts have already been processed to avoid duplicate alerts.

## Trigger

**Schedule** — a CRON expression runs the workflow weekly (e.g. `0 9 * * 1` for every Monday at 9 AM).

## Workflow

<Steps>
  <Step title="Query expiring contracts">
    An [API Request](/automations/steps/http-request) step with the **Royaltyport API** preset queries contracts with term end dates in the next 90 days.
  </Step>

  <Step title="Filter already-notified contracts">
    A [Database](/automations/steps/database) step reads the `notified_contracts` table in an [automation database](/automations/databases) to get a list of contract IDs that have already been processed. A [Code](/automations/steps/code) step filters the expiring contracts list, removing any that already have a record in the table.
  </Step>

  <Step title="Generate renewal briefs">
    A [Loop](/automations/steps/loop) step iterates over the remaining contracts. Inside each iteration, a [Transformer](/automations/steps/transformer) step generates a renewal brief summarizing the parties, current royalty rates, territory scope, and revenue performance.
  </Step>

  <Step title="Create a ticket">
    An [API Request](/automations/steps/http-request) step creates a ticket in a project management tool (Monday, Jira, Asana, or similar) with the renewal brief, contract details, and a link back to the contract in Royaltyport.
  </Step>

  <Step title="Notify the team">
    A [Notification](/automations/steps/notification) step emails the A\&R or business affairs contact with the renewal brief and a link to the created ticket.
  </Step>

  <Step title="Mark as notified">
    A [Database](/automations/steps/database) step inserts the contract ID, notification date, and ticket URL into the `notified_contracts` table so the contract is skipped on future runs.
  </Step>
</Steps>

<Tip>
  The `notified_contracts` automation database table acts as a deduplication log. You can browse it in the [database editor](/automations/databases#editing-a-database) to see which contracts have been flagged and when.
</Tip>

## Key Features Used

* [Schedule trigger](/automations/triggers#schedule) for weekly automated runs
* [Automation database](/automations/databases) for deduplication tracking
* [Transformer](/automations/steps/transformer) for AI-generated renewal briefs
* [Code step](/automations/steps/code) for filtering already-processed contracts
* External API integration with project management tools

## Related Documentation

<CardGroup cols={2}>
  <Card title="Triggers" icon="play" href="/automations/triggers">
    Configure schedule triggers with CRON expressions.
  </Card>

  <Card title="Transformer" icon="sparkles" href="/automations/steps/transformer">
    Use AI to generate structured output from workflow data.
  </Card>

  <Card title="Databases" icon="database" href="/automations/databases">
    Create automation databases for tracking state across runs.
  </Card>

  <Card title="More Examples" icon="lightbulb" href="/automations/examples/overview">
    Browse all example workflows.
  </Card>
</CardGroup>
