> For the complete documentation index, see [llms.txt](https://developer.collibra.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.collibra.com/tutorials/custom-workflows-for-lifecycle-management.md).

# Custom workflows for lifecycle management

When you build a custom workflow that automates an asset lifecycle step that includes one or more assessment reviews, the order and timing of writes to the assessed asset matter. This tutorial describes recommendations to avoid a conflict with the built-in Collibra "Copy Answers" process.

## How "Copy Answers" works

When an assessment review is approved, Collibra automatically copies the assessment answers to attributes and relations of the assessed asset. This process runs asynchronously in the background immediately after the approval.

If a custom workflow writes to the assessed asset at the same moment, two processes attempt to update the same data simultaneously. When the platform detects this conflict, the workflow engine retries the failed step, which can cause:

* Duplicate assets created by the workflow.
* Duplicate email notifications sent to reviewers.
* Intermittent workflow failures that are difficult to diagnose.

These symptoms do not occur predictably, which makes the root cause hard to identify.

## Separate workflow recommendation

Split the automation into two separate workflows: one that handles everything up to and including the approval, and one that performs all post-approval writes.

### Pre-approval workflow

This workflow handles all steps from the start of the process through the approval of the assessment:

* Include the user task where a reviewer approves or rejects the assessment.
* End the workflow by changing the status of the assessment.
* Do not write to the assessed asset after the status changed to **Approved**.

### Post-approval workflow

This workflow performs all writes to the assessed asset after the approval stage:

* Configure it to start on the **Assessment Completed** event. In **Settings** → **Workflows** → **Definitions**, set the workflow to apply to **Assessment** and set the start event to **Assessment Completed**.
* Include all service tasks that create assets, set attributes, or add relations on the assessed asset.

No manual input is required. This workflow starts automatically after Collibra finishes processing the approval, which ensures it never runs at the same time as teh action that copies answers.

This split applies to any assessed asset type, such as AI use cases and data products.

## Workaround for existing single-workflow setups

If you have an existing workflow that handles both the approval and the writing processes, you can stop the conflict by disabling the [**Copy answer to assessed asset** setting](https://productresources.collibra.com/docs/collibra/latest/Content/CollibraAssessments/Templates/co_copy-response-to-assessed-asset.htm) on the assessment template. When this is disabled, the platform no longer copies answers automatically, so the workflow must handle the transfer of the answers.

For the workaround to be viable:

* You must add logic to the workflow to copy each answer to the appropriate attribute or relation.
* Every time the assessment template changes, such as when a question is added or removed, you must update the workflow to match.

{% hint style="warning" %}
Treat this workaround as a short-term measure and apply the two-workflow pattern as the long-term solution.
{% endhint %}
