# Deadline reached

### Input parameters

* TaskID

### How trigger

function should trigger automatic when task deadline is reached.

### Logic

1. The backend should unassign a task after 48 hours if the Task is not accepted by deveoper.. (Probably not a http callable)
2. <mark style="color:green;">get developer document in DB (users/uid)</mark>&#x20;
   1. <mark style="color:green;">remove the</mark> <mark style="color:green;"></mark><mark style="color:green;">**ProjectId**</mark> <mark style="color:green;"></mark><mark style="color:green;">to the</mark> <mark style="color:green;"></mark><mark style="color:green;">**thirdPartyProjects**</mark> <mark style="color:green;"></mark><mark style="color:green;">array</mark>
   2. <mark style="color:green;">Then remove  the</mark> <mark style="color:green;"></mark><mark style="color:green;">**taskId**</mark> <mark style="color:green;"></mark><mark style="color:green;">to the</mark> <mark style="color:green;"></mark><mark style="color:green;">**assignedTasks**</mark> <mark style="color:green;"></mark><mark style="color:green;">array</mark>
3. the task could then be changed back to submitted or drafts, depending on isAssignedToPool boolean.
4. Send an Email to developer and Creator:

* Send First Email:

  * to\_email\_adress = email\_of\_assigned\_person
  * template\_name = "tasks-accept-deadline-reached->developer"
  * data = {taskData: taskData, taskId: taskId}

* Send Second Email:
  * to\_email\_adress = email\_of\_task\_creator
  * template\_name = "tasks-accept-deadline-reached->creator"
  * data = {taskData: taskData, taskId: taskId}


---

# 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://docs.tasksource.io/api-documentation/step-1-taskflow/deadline-reached.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.
