Resource Identifiers
A simulation in NexusFlow will pass through multiple levels at the same time, including models, jobs, calculation runs, and result messages. These objects may appear in the same request or log, but they use different identifiers and are not substitutes for each other.
Before you start integrating, remember three rules:
- The display name is used for reading and the ID is used for locating. The model name, sheet name, component label, and running snapshot name may be modified or repeated and cannot be used as resource IDs.
- The model ID, platform job ID, and job run ID are three different values. They respectively locate editable models, platform job records and a calculation run.
- A model snapshot is not the same kind of snapshot as a running snapshot. The former freezes job input, and the latter saves the kernel state in calculation. The UUIDs of the two cannot be mixed.
The "stable" mentioned on this page means that the same resource remains unchanged during the life cycle of the same platform environment. It does not mean that you will still get the same value after exporting, recreating or migrating. Unless explicitly stated by the interface, all IDs should be saved and passed as-is as opaque values, and no business meaning should be inferred from the format.
List of Logos
The table below illustrates common forms using examples of desensitization. There is no real connection between the examples and they cannot be directly spelled out as a request.
| Logo | Generator | Scope and Stability | Common Forms | Main Use Location |
|---|---|---|---|---|
| workspace type | Specified by the administrator or developer who created the space | Unique within a platform environment; should remain unchanged for the lifetime of the space | liquid_demo | {workspace_type} in the Workbench address, model field type, job field workspace_type, space and component interface, and workspace_type of the SDK |
| User ID | Assigned when the platform server creates a user | Unique within a platform environment; username modification does not affect it | Positive integer, such as 42 | User interface path, created_by, organization membership, space configuration allowed_users |
| Organization ID | Assigned when the platform server creates an organization | Unique within a platform environment; changing the organization name does not affect it | Positive integer, such as 17 | Organization interface path, member interface, space configuration owner_organization and allowed_organizations |
| Model UUID | Generated when the platform server creates or "saves as" a model. | Unique within the platform; renaming and saving the model does not change it, saving as will generate a new value | UUID, such as 1d02d62a-…-5f81609e79c7 | /api/models/{model_id}/, Workbench model address, model_id when creating the job, model.id and job.model_id of the SDK |
| Model Snapshot UUID | Generated when the platform server freezes a model or job input | Unique within the platform; each time a new snapshot is generated you will get a new value | UUID | snapshot_id in the job response; used by the platform to bind the job to the exact input version |
| sheet ID | Generated when Simulation Workbench or SDK creates a sheet | Unique within a model snapshot; renaming and sorting does not change it, copying the sheet generates new values | sheet_0、sheet_3 | Model snapshot sheets[].id, sheet deep link of model or job, sheet_id in verification results |
| component ID | Generated when Simulation Workbench or SDK places a component | Unique within the entire model snapshot; modifying labels and parameters does not change it, copying the component will generate new values | pipe_12、source_3 | Model snapshot nodes[].id or edges[].id where the line component is located, cell of the connection endpoint, component.id of the SDK, component deep link |
| Connection ID | Generated when Simulation Workbench or SDK creates a connection | Unique within the entire model snapshot; modifying the path does not change it, copying the wire will generate a new value | edge_7 | Model snapshot edges[].id, SDK's connection.id, connection deep link, element_id in the verification result |
| Platform job UUID | The job creator can submit it; if it is not submitted, it will be generated by the platform server. | Unique within the platform; job status changes do not change it | UUID | /api/jobs/{job_id}/, real-time connection, Workbench #/tasks/{job_id}, SDK job.id, job input global._jobID |
| Job running ID | Specified by global.taskID in the input when creating the job; supplemented by the running process when no valid value is provided | Identifies the underlying compute run only once; usually stable for the duration of that job run | UUID, custom string, or string form of time value | task_id in the job response, kernel environment variable TASK_ID, calculation example reading, and result and instruction transmission channels |
| Run snapshot ID | Generated by the party requesting to save the running snapshot, registered and verified by the platform; it can be generated by the platform when automatically saving | Unique within the platform; the record is stable during the period of availability and cannot be used after expiration or deletion. | UUID | /api/jobs/runtime-snapshots/{snapshot_id}/, SDK running snapshot method, control message payload.snapshot_id |
| Result message ID | The platform distributes the results in order when receiving the results of a job | Unique only within the result stream of a platform job; increasing from 0 | Non-negative integers, such as 0, 1, 2 | Real-time result message top layer id, reconnection parameter offset, message returned by SDK id |
Common forms of component and wire IDs come from the current editor's default generation rules, but the interface only requires that they be unique non-empty strings within the snapshot. Don't split IDs by underscores, and don't assume that the prefix must equal the component type. IDs generated by legacy models, imported models, or other SDKs may take different forms.
The Three Most Confusing Mission-Related Logos
Model UUID: Locates a Model That Can Be Edited Further
The model UUID corresponds to a model resource in a personal model or shared model. Use this when reading, updating, deleting, or opening a model from the Workbench:
/api/models/{model_id}/
/workbench/{workspace_type}/{model_id}/
When creating a job, you can put it into the requested model_id to establish the association between the job and the source model. Saving the model after the job is created will not change the created job snapshot.
Do not put the model UUID into /api/jobs/{job_id}/ and do not replace it with the model name. current_snapshot in the model details response is the data content of the current snapshot, not the model snapshot UUID.
Platform Job UUID: Locate Job Resources in the Platform
The platform job UUID corresponds to a job record that can be queried, authorized, and the results can be viewed. Job details, logs, stop operations, live connection tickets, and the Simulation Workbench job view all use it to locate jobs:
/api/jobs/{job_id}/
/api/jobs/{job_id}/logs/
/api/jobs/{job_id}/websocket-ticket/
#/tasks/{job_id}
job.id in the SDK also has this value. When the platform delivers job input, it will write the same UUID into graph.global._jobID. If the simulation kernel needs to generate a link back to the job page, it should use _jobID instead of TASK_ID in the runtime environment.
Job Run ID: Let Calculations and Messages Find the Same Run
The job running identifier connects the calculation example, calculation process, result channel and instruction channel. It uses task_id in public job responses, comes from graph.global.taskID in job inputs, and appears as TASK_ID in the computing environment.
This value is not necessarily the platform job UUID. It may be set by the caller or may be supplemented by the running process; its format should not be used as a platform resource UUID check. Only interfaces that explicitly require run identification can use it, such as reading the kernel calculation example corresponding to the current run:
/api/jobs/case-file/{task_id}
Do not use task_id to query /api/jobs/{job_id}/, do not use it to splice #/tasks/{job_id}, and do not write it into the model associated field model_id. See Read Job Input for more input fields.
Two Snapshot UUIDs
Model Snapshot UUID
When you save the model and submit a new snapshot_data, the platform creates a new model snapshot and switches the model's current state to it. When creating a job, the platform will also freeze the input of this job as a snapshot; the job points to this input through snapshot_id.
Therefore:
- The model UUID represents "which model", and the model snapshot UUID represents "which version of data is used by this model or job";
- If the same model is saved twice in a row, the model UUID will remain unchanged, but the generated snapshot UUID will be different;
snapshot_idin the job response can be used to audit the job input version, but thecurrent_snapshotreturned by the current model interface is the snapshot content, not the UUID;- The model snapshot UUID has no meaning for reading, restoring, or deleting using the running snapshot interface.
Run Snapshot ID
Running snapshots save the state of the simulation kernel running to a certain moment and are used for continued running or debugging processes supported by the platform. It is related to the source job, but is neither the source job's job_id nor the job's model snapshot snapshot_id .
The running snapshot ID appears in:
idrunning snapshot list and detail response;/api/jobs/runtime-snapshots/{snapshot_id}/;- SDK’s
request_runtime_snapshot()return value and running snapshot query method; payload.snapshot_idthat saves the running snapshot control message;graph.global.started_from_runtime_snapshotin the job input when creating a new job from a running snapshot.
The same field name snapshot_id will represent a model snapshot or a running snapshot depending on the structure. When judging, you must look at both the resource path and the parent object: snapshot_id in the job summary is a model snapshot, runtime-snapshots in the resource and snapshot_id in the control message is a running snapshot.
How snapshots are generated, retained and affect subsequent jobs, see Model, Job, Result, and Snapshot Lifecycles.
Sheet, Component, and Wire IDs
Sheet ID and Sheet Name
The sheet name is user-oriented, such as "Inlet Pipe Network" or "Steady-State Conditions"; the sheet ID is oriented to model structure and navigation, such as sheet_2. Renaming the sheet only changes name, not id.
The current sheet structure requires that IDs use the form sheet_0 or sheet_1 and be unique within the same model snapshot. When you copy a sheet, the copy will get a new sheet ID, and the components and wires in the copy will also get new IDs.
Deep links should also bring the corresponding model or job:
/workbench/{workspace_type}/{model_id}/#/model/sheets/{sheet_id}
/workbench/{workspace_type}/{model_id}/#/tasks/{job_id}/sheets/{sheet_id}
Saving just sheet_2 gives no indication of which model or job it belongs to. sheet_id in the verification result must also be interpreted in conjunction with the model snapshot being verified this time.
Component ID, Component Type, and Component Tag
A component may have at least three names appearing at the same time:
| Content | Answered Questions | Example |
|---|---|---|
| component ID | Which component instance in the model is this | pipe_12 |
| component type identifier | Which component definition is it created from | pipe |
| component tag | What name does the user see on the canvas | 出口管段 |
The component type identifier will be written into nodeClassID of the node or line component; the component instance ID will be written into id of the corresponding element. Multiple components can use the same nodeClassID , but the same element id cannot be used in the same model snapshot. Tags can be modified or repeated.
The component.id of the SDK, element_id in the verification result, the node segment in the deep link, and the connection endpoints source.cell and target.cell all refer to the element ID, not nodeClassID or the label.
Wire IDs and Endpoint References
The connected id is used for selection, deletion, verification positioning and deep linking; the connected source.cell and target.cell refer to the component IDs at both ends of the connection. The connection ID cannot be written into the endpoint's cell instead of the component ID.
Both ends of the physical connection must be on the same sheet, but the component and connection IDs in all sheets must still remain unique within the entire model snapshot. It is recommended to save both sheet_id and element_id when locating elements: even if the current ID is enough to find the element, the sheet information can still make logs, interface jumps and problem reports clearer.
Model job snapshots retain the sheet, component, and wire IDs from when the job was created. Copying, deleting or rebuilding model elements later will not synchronously overwrite elements in the old job, so job results and deep links should be based on the job snapshot.
User, Organization and Workspace Identities
Users and Organizations Use Integer IDs
Both user ID and organization ID are assigned by the platform server, but they belong to different resource types. Even if the values happen to be the same, they are not interchangeable.
/api/users/{user_id}/
/api/organizations/{organization_id}/
/api/organizations/{organization_id}/members/{user_id}/
Username, email, and organization name are used for display, login, or search; authorization relationships should use the integer ID returned by the interface. allowed_users in the workspace configuration holds the user ID, and owner_organization and allowed_organizations hold the organization ID. Do not write usernames or organization names directly into these fields.
These integers only have meaning within the context of the current platform. When migrating the configuration, users and organizations must be re-parsed in the target environment. It cannot be assumed that 17 in the test environment and 17 in the production environment represent the same organization.
Workspace Type and Display Prefix
The workspace type is a stable identifier of the space and is part of the model type and Workbench routing. The Workbench prefix is the user-facing portal name. Modifying the display prefix should not change workspace_type, nor should creating a space with another type be equivalent to renaming.
Values of the same type will appear in different fields of different interfaces:
- The space and component interface paths use
/api/meta/{workspace_type}/; - The Workbench address uses
/workbench/{workspace_type}/...; - Model response uses field
type; - Job response and creation parameters use field
workspace_type; - The SDK's model and metadata methods use
workspace_type.
Do not use Workbench prefixes, home page entry text, or space owning organizations in place of type values. When creating models and jobs, the workspace type must also be consistent with the actual type of the model.
Result Message ID and Resume Reading After Disconnection
Each real-time result message has a top-level integer id. The platform allocates the same job incrementally starting from 0 in the order of reception:
{"id": 18, "key": "result_group", "verb": "append", "type": "log", "data": {}}
This ID is a position in the result stream, not the ID of a result variable, component, job, or database resource. Its main purpose is to ensure orderly processing and continuous reading after disconnection: after processing the message 18, the next connection continues from offset=19.
The job field msg_num indicates the current total number of result messages. For a complete result stream numbered consecutively from 0, the ID of the last message at the end is usually msg_num - 1; do not treat msg_num itself as a message ID, and do not assume that each job has at least one result message.
When the SDK reads the result in a streaming manner, it will return id of the message and update the read continuation position accordingly. If the business party needs to persist the consumption progress, it should save the "next offset" and save it together with the platform job UUID:
(job_id, next_offset)
Different jobs can have message 0, so saving the message ID alone cannot locate a result. key of the message is used for result grouping and type represents the result type, neither of which can replace the message ID. For details on real-time connection and message structure, see Real-Time Job Data Over WebSocket.
Different Field Names Do Not Mean They Can Be Interchanged
The same value may use different naming styles at different boundaries:
| Border | Common Fields |
|---|---|
| REST API requests and responses | model_id、snapshot_id、workspace_type、task_id |
| The REST API resource itself | Usually id is used, the meaning is determined by the current resource |
| Simulation Workbench routing status | jobId、sheetId、nodeId、edgeId |
| SDK object | model.id、job.id、job.model_id、job.task_id、component.id |
| simulation kernel input and environment | global._jobID、global.taskID、TASK_ID |
| Result message | Top layer id, key, type, verb |
The same field names do not necessarily represent the same type of resources. For example, id in different detailed responses may be model, job or running snapshot IDs respectively; snapshot_id will also appear in model snapshots and running snapshots. When parsing data, you should first determine the parent resource and interface path, and then interpret the fields.
The uppercase and lowercase, underscore, and plural forms of field names belong to the interface contract. Do not convert them yourself before sending. Path parameters should be URL encoded when used; UUIDs, string IDs, and integer IDs should be read as the type declared by API Conventions. The specific structure is subject to Data Schema Index.
Integration Checklist
- Each variable name can describe the resource type, such as
model_id,job_id,runtime_task_id. The ambiguousidis not used to pass between multi-layer functions. - The model API, job API, and Workbench job deep linking use the model UUID and platform job UUID respectively, without using the job run ID instead.
- The kernel uses
TASK_IDto connect the input, results and instructions of this run; use_jobIDin the input when you need to return to the platform job page. - The
snapshot_idof the job is stored separately from thesnapshot_idof the running snapshot resource, and the parent of the field is clear. - The sheet name, component tag, model name and running snapshot name are only for display and do not participate in resource association.
- Component and wire IDs are unique within the entire model snapshot; wire endpoints refer to the component ID of the same sheet.
- User and organization authorization uses the integer ID returned by the target environment interface, without copying the value from the other environment.
- The result consumption progress also saves the platform job UUID and the next message offset, and can handle disconnection reconnection and repeated messages.
- When logging identification, the resource type is also recorded, and tokens, passwords, or complete request bodies containing sensitive parameters are not recorded.
Next Steps
- To understand the sequence of models, jobs, model snapshots, running snapshots, and results, please read Model, Job, Result, and Snapshot Lifecycles.
- Before writing REST API calls, read API Conventions.
- To find the exact fields and types of an interface or message, use Data Schema Index.
- To view the specific interfaces of models and jobs, please read Model and Snapshot APIs and Job, Control, and Result APIs respectively.