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

# Tasks

export const LwTemplate = ({title = "Key questions to get you started", icon = "sparkles", cta = "Powered by Agent Studio", linkHref = "https://lucidworks.com/demo/?utm_source=docs&utm_medium=referral&utm_campaign=docs_cta_ai"}) => {
  const [isLoaded, setIsLoaded] = useState(false);
  useEffect(() => {
    const timer = setTimeout(() => {
      setIsLoaded(true);
    }, 500);
    return () => clearTimeout(timer);
  }, []);
  return <div className="lw-template-container">
      <Card title={title} icon={icon}>
        {isLoaded && <span dangerouslySetInnerHTML={{
    __html: `<lw-template id="a029c1a9-28be-427e-b0e1-5d918920246a"></lw-template
            >`
  }} />}
        <Link href={linkHref} className="agent-studio-link text-left text-gray-600 gap-2 dark:text-gray-400 text-sm font-medium flex flex-row items-center hover:text-primary dark:hover:text-primary-light group-hover:text-primary group-hover:dark:text-primary-light">Powered by Lucidworks Agent Studio</Link>
      </Card>
    </div>;
};

[localhost link]: http://localhost:3000/docs/5/fusion/operations/jobs-and-scheduling/tasks

[mintlify link]: https://doc.lucidworks.com/docs/5/fusion/operations/jobs-and-scheduling/tasks

[old doc.lw link]: https://doc.lucidworks.com/fusion/5.9/183

Tasks are a flexible job type that can be used to clean up old logs or run any REST call.

<LwTemplate />

## Task subtypes

The "task" job type has the following subtypes:

* [Log Cleanup](/docs/5/fusion/reference/config-ref/jobs/log-cleanup-jobs)\
  Log cleanup jobs are run against your system logs collection to delete log messages that were created prior to the number of days specified in the `Delete logs older than "n" days` field.

To create a log cleanup job, sign in to Fusion and click **Collections > Jobs**. Then click **Add+** and in the Custom and Other Jobs section, select **Log Cleanup**. You can enter parameters to configure the job. If the field has a default value, it is populated when you click to add the job.

## Parameters

* **ID.** The unique ID for this job in the API. This is the `id` field in the configuration file. Required field.
* **Logs Collection.** The collection that contains the documents that are deleted when the job is run. The allowed value is **system\_logs**. This is the `collection` field in the configuration file. Required field.
* **Delete logs older than "n" days.** The number of days to retain system log messages. When this job is run, it deletes all system log messages older than the number of days entered in this field. This is the `days` field in the configuration file. Optional field.
* **Query to match docs to delete.** The query syntax to identify the documents to be deleted. The default value of `-logger_class_s:"com.lucidworks.cloud.gateway.audit"` excludes audit log entries to preserve audit information such as login and logout events. This is the `query` field in the configuration file. Optional field.
* [REST Call](/docs/5/fusion/reference/config-ref/jobs/rest-call)\
  A versatile job type that runs an arbitrary REST/HTTP/Solr command.

REST jobs can call external systems using:

* any HTTP or HTTPS request: `<http-protocol>://<path>`; requires JWT header.
* a Solr request: `solr://COLLECTION_NAME/…​`; authentication is handled.
* a Fusion service request: `extservice://SERVICE_NAME/<path>`; authentication is handled.

To create a REST Call job, sign in to Fusion and click **Collections > Jobs**. Then click **Add+** and in the Custom and Other Jobs section, select **REST Call**. You can enter parameters to configure the job. If the field has a default value, it is populated when you click to add the job.

The parameters for this job are:

* **ID.** The user-defined name for this job. This is the `id` field in the configuration file. Required field.
* **Endpoint URI.** The name or location of the data this job searches. This is the `uri` field in the configuration file. Required field.
* **Call method.** The operation submitted in the request. Values are GET, POST, PUT, or DELETE. This is the `method` field in the configuration file. Required field.
* **Query parameters.** This section lets you enter `property name:property value` options submitted in the query. This is the `queryParams` field in the configuration file. Optional field.
* **Request protocol headers.** This section lets you enter `property name:property value` protocol headers submitted in the query. This is the `headers` field in the configuration file. Optional field.
* **Request entity.** The request string to submit for the query. This is the `entity` field in the configuration file. Optional field.

## Task configuration

Tasks can be created and modified using the [Fusion UI](/docs/5/fusion/operations/jobs-and-scheduling/overview). They can be scheduled using the Fusion UI or the [Jobs API](/api-reference/get-job-histories/get-a-jobs-history).

**See also [Jobs Configuration Reference](/docs/5/fusion/reference/config-ref/jobs/overview).**
