HYBRID IN.
← Back to OME

OME Scripts

Easy Workflow Automation

Write simple scripts to automate complex operations — manage users, deploy systems, and orchestrate workflows with minimal code.

Script Capabilities

User Management

Automate user provisioning, role assignments, and access control across your entire organization.

System Deployment

Deploy and configure systems with repeatable scripts that ensure consistency across environments.

Workflow Orchestration

Chain multiple operations together with conditional logic and error handling.

Event Response

Trigger scripts automatically based on events from COGNIT MESH or external systems.

Human in the Loop Integration

OME scripts integrate seamlessly with Human in the Loop (HIT) for critical operations requiring human approval.

Approval Gates

Add approval checkpoints in scripts for sensitive operations like data deletion or system changes.

Contextual Information

Provide human reviewers with full context about the operation before requesting approval.

Audit Trail

All approvals and script executions are logged for compliance and accountability.

Example Scripts

User Management

Automatically provision new users across all systems when they join your organization.

1// User provisioning script
2const newUser = event.data.user;
3
4// Create user in identity system
5await identity.createUser({
6  email: newUser.email,
7  name: newUser.name,
8  role: newUser.role
9});
10
11// Assign to appropriate groups
12await identity.addToGroup(newUser.id, newUser.department);
13
14// Send onboarding email
15await email.send({
16  to: newUser.email,
17  template: 'onboarding',
18  data: { name: newUser.name }
19});
20
21log('User provisioned:', newUser.email);

Event Triggers

Respond to system events with automated workflows and notifications.

1// Alert response script
2const alert = event.data.alert;
3
4if (alert.severity === 'critical') {
5  // Notify on-call team
6  await pagerduty.trigger({
7    service: 'operations',
8    description: alert.message,
9    urgency: 'high'
10  });
11  
12  // Create incident ticket
13  await jira.createTicket({
14    summary: alert.message,
15    priority: 'P1',
16    labels: ['incident', 'automated']
17  });
18  
19  // Escalate to leadership
20  await slack.send({
21    channel: '#leadership',
22    text: `Critical alert: ${alert.message}`
23  });
24}

HIT Approval

Require human approval for sensitive operations with full context.

1// Data deletion with approval
2const request = event.data.deletion;
3
4// Request human approval
5const approval = await hit.requestApproval({
6  title: 'Delete user data',
7  description: `Delete data for user ${request.userId}`,
8  context: {
9    userId: request.userId,
10    reason: request.reason,
11    dataCount: request.dataCount
12  },
13  approvers: ['security-team', 'compliance']
14});
15
16if (approval.approved) {
17  // Execute deletion
18  await database.deleteUserData(request.userId);
19  await audit.log({
20    action: 'data_deletion',
21    userId: request.userId,
22    approvedBy: approval.approver
23  });
24} else {
25  log('Deletion denied:', approval.reason);
26}