Publishing New Values

New values for Published Attributes can be provided in several ways as described in this section.

/published-attributes API endpoint

The best and most common way to publish new values is by using the /published-attributes endpoint. By using this endpoint, you can send values only when they are first set or later updated. At all other times, the system will supply the values for you as needed in your workflows.

Using this same endpoint, you can also backfill currently existing values. This is especially helpful when you define a new Published Attribute and want the Alloy system to be able use data you already have. You can provide a timestamp for each historical value so the system will know whether each value should be considered expired or not, if you have defined an expiration time. There is a maximum number of values you can publish per call. See the Published Attributes API documentation for details.

/evaluations API

When you call the /evaluations endpoint to start an evaluation, you normally include any Input Attributes in the payload that the corresponding workflow requires. With Published Attributes, if you have already published the latest values, you don't need to include the value in the payload at all. It will automatically be provided. But if you haven't published a value for some reason, any value that you include in the payload for the Published Attribute will be published into the system at that time.

When an /evaluation payload is received, it will be searched for all of your Published Attribute names. The key for the Published Attribute must be at the top level of the payload and must match the Published Attribute name exactly. If a Published Attribute is found, the value associated with that key will be published into the system.

/entities API via the Meta Field

When you call the /entities API to either create an Entity or update data for an Entity, you can include new Published Attribute values in the meta portion of the payload. You must provide a key directly under the meta field with the exact same name as the Published Attribute.

In Batch Files

Clients who send us data in batch files can send us data for Entities. Whenever we receive Entity data this way, we check the name of each column to see if it matches the name of a Published Attribute the client has defined. Again, it must be an exact match. For all Published Attributes that are identified, we publish a new value in the system for every included Entity that provides a value for the attribute. Those values will then be available to any workflows that run after that point.

From Published Attributes as Output Attributes

Published Attributes can be used as Output Attributes in a workflow. When they are, the system will generate new values and publish them to the system each time an Evaluation for the workflow runs. See Output Attribute Usage for details.

Additional Notes

Name Changes

The name of a Published Attribute can be modified because the assigned token is the unique identifier for the Published Attribute. Care should still be taken, however, if the name is modified. If new Published Attribute values are sent into the system via the /entities or /evaluations endpoints or in batch files using the name, those references must be updated to match the new name or they will not be recognized as new Published Attribute values.

Applying JQ Filter

Whenever a new value is received into the system, before publishing it the system will check to see if the corresponding Published Attribute definition has a JQ filter specified. If so, it will apply that filter to the value first and then publish the resulting value. Note that this only applies to values that are received from users, not to those generated within the system - i.e., from Output Attributes. See details at: Published Attributes and JQ.