---
title: "Workflow"
description: "Workflow"
url: "https://www.contentstack.com/docs/developers/sdks/content-management-sdk/java/reference/workflow"
product: "Contentstack"
doc_type: "guide"
audience:
  - developers
  - admins
version: "current"
last_updated: "2026-09-04"
---

# Workflow

## Workflow

Workflow is a tool that allows you to streamline the process of content creation and publishing and lets you manage the content lifecycle of your project smoothly.

## updatePublishRule

The "Add or Update Publish Rules" request allows you to add a publishing rule or update the details of the existing publishing rules of a workflow.

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Workflow workflow = contentstack.stack().workflow();
Call<ResponseBody> response = workflow.updatePublishRule("ruleUid", requestBody).execute();
if (response.isSuccessful) {
    System.out.println("Response" + response);
}
```

The UID of the publishing rule that you want to update.

The request body.

## fetchPublishContentType

The "Get Publish Rules by Content Types" request allows you to retrieve details of a Publish Rule applied to a specific content type of your stack.

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Workflow workflow = contentstack.stack().workflow();
Call<ResponseBody> response = workflow.fetchPublishRuleContentType("contentTypeUid").execute();
if (response.isSuccessful) {
    System.out.println("Response" + response);
}
```

The UID of the content type of which you want to retrieve the Publishing Rule.

## deletePublishRule

The "Delete Publish Rules" request allows you to delete an existing publish rule.

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Workflow workflow = contentstack.stack().workflow();
Call<ResponseBody> response = workflow.deletePublishRule("ruleUid").execute();
if (response.isSuccessful) {
    System.out.println("Response" + response);
}
```

The UID of the published rule that you want to delete.

## createPublishRule

The "Create Publish Rules" request allows you to create publish rules for the workflow of a stack.

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Workflow workflow = contentstack.stack().workflow();
Call<ResponseBody> response = workflow.createPublishRule(requestBody).execute();
if (response.isSuccessful) {
	System.out.println("Response" + response);
}
```

Specify the unique IDs of the branches for which the publishing rule will be applicable in the schema in the request body.

## fetchTasks

The "Get all Tasks" request retrieves a list of all tasks assigned to you.

When executing the API request, in the 'Header' section, you need to provide the API Key of your stack and the authtoken that you receive after logging into your account.

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Workflow workflow = contentstack.stack().workflow();
Call<ResponseBody> response = workflow.fetchTasks().execute();
if (response.isSuccessful) {
	System.out.println("Response" + response);
}
```

## disable

Disable Workflow request allows you to disable a workflow.

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Workflow workflow = contentstack.stack().workflow();
Call<ResponseBody> response = workflow.disable().execute();
if (response.isSuccessful) {
	System.out.println("Response" + response);
}
```

## enable

The "Enable Workflow" request allows you to enable a workflow.

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Workflow workflow = contentstack.stack().workflow();
Call<ResponseBody> response = workflow.enable().execute();
if (response.isSuccessful) {
	System.out.println("Response" + response);
}
```

## update

The "Add or Update Workflow" request allows you to add a workflow stage or update the details of the existing stages of a workflow.

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Workflow workflow = contentstack.stack().workflow();
Call<ResponseBody> response = workflow.update(requestBody).execute();
if (response.isSuccessful) {
	System.out.println("Response" + response);
}
```

The body should be in JSONObject format.

## create

The "Create a Workflow" request allows you to create a Workflow.

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Workflow workflow = contentstack.stack().workflow();
Call<ResponseBody> response = workflow.create(requestBody).execute();
if (response.isSuccessful) {
	System.out.println("Response" + response);
}
```

The details of the workflow in JSONObject format.

## delete

The "Delete webhook" call deletes an existing webhook from a stack.

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Workflow workflow = contentstack.stack().workflow();
Call<ResponseBody> response = workflow.delete().execute();
if (response.isSuccessful) {
	System.out.println("Response" + response);
}
```

## fetch

The "Get a Single Workflow" request retrieves the comprehensive details of a specific Workflow of a stack.

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Workflow workflow = contentstack.stack().workflow();
Call<ResponseBody> response = workflow.fetch().execute();
if (response.isSuccessful) {
	System.out.println("Response" + response);
}
```

## find

The "Get a Single Workflow" request retrieves the comprehensive details of a specific Workflow of a stack.

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Workflow workflow = contentstack.stack().workflow();
Call<ResponseBody> response = workflow.find().execute();
if (response.isSuccessful) {
	System.out.println("Response" + response);
}
```

## addParam

Sets header for the request.

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Workflow workflow = contentstack.stack().workflow();
workflow.addParam("key", value);
```

Query parameter key for the request.

Query parameter value for the request.

## removeParam

Set header for the request.

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Workflow workflow = contentstack.stack().workflow();
workflow.removeParam("key");
```

Removes query parameters using the key of the request.

## addHeader

Sets header for the request.

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Workflow workflow = contentstack.stack().workflow();
workflow.addHeader("key", value);
```

Header key for the request.

Header value for the request.

## Workflow | Java Management SDK | Contentstack

Workflow lets you streamline content creation and publishing to smoothly manage your project's content lifecycle in the Java Management SDK.