The ApplicationClient manages applications in Conductor. Applications are security entities that can be granted access keys and roles to interact with Conductor workflows and tasks.
Creates a new ApplicationClient.
Parameters:
client(Client): An instance ofClient.
Gets all applications registered in Conductor.
Returns:
Promise<ExtendedConductorApplication[]>: An array of all applications.
Example:
import { ApplicationClient } from "@io-orkes/conductor-javascript";
const appClient = new ApplicationClient(client);
// Get all applications
const applications = await appClient.getAllApplications();
console.log(`Found ${applications.length} applications`);Creates a new application.
Parameters:
applicationName(string): The name of the application to create.
Returns:
Promise<ExtendedConductorApplication>: The created application.
Example:
import { ApplicationClient } from "@io-orkes/conductor-javascript";
const appClient = new ApplicationClient(client);
// Create a new application
const app = await appClient.createApplication("my-service");
console.log(`Created application: ${app.id}`);Gets an application by its ID.
Parameters:
applicationId(string): The ID of the application.
Returns:
Promise<ExtendedConductorApplication>: The application.
Example:
import { ApplicationClient } from "@io-orkes/conductor-javascript";
const appClient = new ApplicationClient(client);
// Get a specific application
const app = await appClient.getApplication("app-123");
console.log(`Application name: ${app.name}`);Gets an application by its access key ID.
Parameters:
accessKeyId(string): The access key ID.
Returns:
Promise<ExtendedConductorApplication>: The application associated with the access key.
Example:
import { ApplicationClient } from "@io-orkes/conductor-javascript";
const appClient = new ApplicationClient(client);
// Get application by access key
const app = await appClient.getAppByAccessKeyId("key-123");
console.log(`Application: ${app.name}`);updateApplication(applicationId: string, newApplicationName: string): Promise<ExtendedConductorApplication>
Updates an application's name.
Parameters:
applicationId(string): The ID of the application to update.newApplicationName(string): The new name for the application.
Returns:
Promise<ExtendedConductorApplication>: The updated application.
Example:
import { ApplicationClient } from "@io-orkes/conductor-javascript";
const appClient = new ApplicationClient(client);
// Update application name
const app = await appClient.updateApplication("app-123", "my-service-v2");
console.log(`Updated application name to: ${app.name}`);Deletes an application.
Parameters:
applicationId(string): The ID of the application to delete.
Returns:
Promise<void>
Example:
import { ApplicationClient } from "@io-orkes/conductor-javascript";
const appClient = new ApplicationClient(client);
// Delete an application
await appClient.deleteApplication("app-123");
console.log("Application deleted");Gets all access keys for an application.
Parameters:
applicationId(string): The ID of the application.
Returns:
Promise<AccessKeyInfo[]>: An array of access key information.
Example:
import { ApplicationClient } from "@io-orkes/conductor-javascript";
const appClient = new ApplicationClient(client);
// Get access keys for an application
const keys = await appClient.getAccessKeys("app-123");
console.log(`Found ${keys.length} access keys`);
keys.forEach((key) => {
console.log(`Key ${key.id}: ${key.status}`);
});Creates a new access key for an application.
Important: Save the access key secret immediately after creation - it cannot be retrieved later.
Parameters:
applicationId(string): The ID of the application.
Returns:
Promise<AccessKey>: The created access key with its secret.
Example:
import { ApplicationClient } from "@io-orkes/conductor-javascript";
const appClient = new ApplicationClient(client);
// Create a new access key
const accessKey = await appClient.createAccessKey("app-123");
console.log(`Key ID: ${accessKey.id}`);
console.log(`Key Secret: ${accessKey.secret}`); // Save this immediately!Deletes an access key.
Parameters:
applicationId(string): The ID of the application.keyId(string): The ID of the access key to delete.
Returns:
Promise<void>
Example:
import { ApplicationClient } from "@io-orkes/conductor-javascript";
const appClient = new ApplicationClient(client);
// Delete an access key
await appClient.deleteAccessKey("app-123", "key-456");
console.log("Access key deleted");Toggles the status of an access key between ACTIVE and INACTIVE.
Parameters:
applicationId(string): The ID of the application.keyId(string): The ID of the access key.
Returns:
Promise<AccessKeyInfo>: The updated access key information.
Example:
import { ApplicationClient } from "@io-orkes/conductor-javascript";
const appClient = new ApplicationClient(client);
// Toggle access key status
const keyInfo = await appClient.toggleAccessKeyStatus("app-123", "key-456");
console.log(`Access key is now ${keyInfo.status}`);Adds a role to an application user.
Parameters:
applicationId(string): The ID of the application.role(ApplicationRole): The role to add.
Returns:
Promise<void>
Example:
import { ApplicationClient, ApplicationRole } from "@io-orkes/conductor-javascript";
const appClient = new ApplicationClient(client);
// Add a role to the application
await appClient.addApplicationRole("app-123", "WORKFLOW_MANAGER");
console.log("Role added");
// You can also use the ApplicationRole type
const role: ApplicationRole = "METADATA_MANAGER";
await appClient.addApplicationRole("app-123", role);Removes a role from an application user.
Parameters:
applicationId(string): The ID of the application.role(string): The role to remove.
Returns:
Promise<void>
Example:
import { ApplicationClient } from "@io-orkes/conductor-javascript";
const appClient = new ApplicationClient(client);
// Remove a role from the application
await appClient.removeRoleFromApplicationUser("app-123", "WORKFLOW_EXECUTOR");
console.log("Role removed");Gets all tags associated with an application.
Parameters:
applicationId(string): The ID of the application.
Returns:
Promise<Tag[]>: An array of tags.
Example:
import { ApplicationClient } from "@io-orkes/conductor-javascript";
const appClient = new ApplicationClient(client);
// Get tags for an application
const tags = await appClient.getApplicationTags("app-123");
console.log(`Application has ${tags.length} tags`);Adds multiple tags to an application (replaces existing tags).
Parameters:
applicationId(string): The ID of the application.tags(Tag[]): An array of tags to add.
Returns:
Promise<void>
Example:
import { ApplicationClient } from "@io-orkes/conductor-javascript";
const appClient = new ApplicationClient(client);
// Add tags to an application
await appClient.addApplicationTags("app-123", [
{ key: "environment", value: "production" },
{ key: "team", value: "backend" },
{ key: "service", value: "payment" },
]);Adds a single tag to an application.
Parameters:
applicationId(string): The ID of the application.tag(Tag): The tag to add.
Returns:
Promise<void>
Example:
import { ApplicationClient } from "@io-orkes/conductor-javascript";
const appClient = new ApplicationClient(client);
// Add a single tag
await appClient.addApplicationTag("app-123", {
key: "version",
value: "2.0",
});Deletes multiple tags from an application.
Parameters:
applicationId(string): The ID of the application.tags(Tag[]): An array of tags to delete.
Returns:
Promise<void>
Example:
import { ApplicationClient } from "@io-orkes/conductor-javascript";
const appClient = new ApplicationClient(client);
// Delete multiple tags
await appClient.deleteApplicationTags("app-123", [
{ key: "environment", value: "production" },
{ key: "team", value: "backend" },
]);Deletes a specific tag from an application.
Parameters:
applicationId(string): The ID of the application.tag(Tag): The tag to delete (must match bothkeyandvalue).
Returns:
Promise<void>
Example:
import { ApplicationClient } from "@io-orkes/conductor-javascript";
const appClient = new ApplicationClient(client);
// Delete a specific tag
await appClient.deleteApplicationTag("app-123", {
key: "version",
value: "2.0",
});export interface ExtendedConductorApplication {
id: string;
name: string;
createdBy: string;
createTime: number;
updatedBy: string;
updateTime: number;
tags?: Array<Tag>;
};export interface AccessKey {
id: string;
secret: string;
};export interface AccessKeyInfo {
id: string;
createdAt: number;
status: "ACTIVE" | "INACTIVE";
};export type Tag = {
key?: string;
/**
* @deprecated
*/
type?: string;
value?: string;
};Defines the available roles that can be assigned to an application.
export type ApplicationRole =
| "ADMIN"
| "UNRESTRICTED_WORKER"
| "METADATA_MANAGER"
| "WORKFLOW_MANAGER"
| "APPLICATION_MANAGER"
| "USER"
| "USER_READ_ONLY"
| "WORKER"
| "APPLICATION_CREATOR"
| "METADATA_API"
| "PROMPT_MANAGER";Role Descriptions:
ADMIN- Full administrative access to all resourcesUNRESTRICTED_WORKER- Can execute any task without restrictionsMETADATA_MANAGER- Can manage workflow and task definitionsWORKFLOW_MANAGER- Can manage workflow executionsAPPLICATION_MANAGER- Can manage applications and access keysUSER- Standard user accessUSER_READ_ONLY- Read-only access to resourcesWORKER- Can poll for and execute assigned tasksAPPLICATION_CREATOR- Can create new applicationsMETADATA_API- API access to metadata operationsPROMPT_MANAGER- Can manage AI prompts and templates