# Rule

> Type reference for Rule in the Rippling SDK, including its public shape and related types.

Defines a record-triggered automation rule and registers it with the manifest.

A rule fires automatically when a record on the parent custom object is created, updated, or both — depending on `triggerType`. Each rule runs a list of actions that set field values, optionally guarded by an RQL condition.

## Type definition

```
export declare class Rule {
    constructor(customObject: ObjectReference, props: RuleProps & {
        apiName: Config['api_name'];
    });
    getFlowId(): string;
    getCustomObjectApiName(): string;
    getApiName(): Config['api_name'];
    toDict(): Config;
}
```

## Related types

-   [ObjectReference](https://developer.rippling.com/documentation/js-sdk/metadata-sdk/reference/types/ObjectReference-7acb30a9)
-   [RuleProps](https://developer.rippling.com/documentation/js-sdk/metadata-sdk/reference/types/RuleProps-4af98d01)

Source: https://developer.rippling.com/documentation/js-sdk/metadata-sdk/reference/types/Rule-1d12c3b8

> For the complete documentation index, see [llms.txt](https://developer.rippling.com/llms.txt). Public pages have a Markdown version at the same URL with .md added.
