Developer Guide
NexusFlow divides the definition of simulation capabilities, model editing, job scheduling, calculation execution and result display into collaborative modules. Developers can only implement the section they are responsible for, but they need to understand the upstream and downstream data boundaries first so that components, models, jobs and results can be stably connected.
This guide is intended for three types of developers:
- Component and Workbench Extension Developers: Define workspace, component, port, parameters, instructions and global parameters.
- Simulation Kernel Developer: Receive job input, drive the calculation process, and return status, logs and results as agreed.
- SDK and API Integrator: Manage models and jobs from scripts or external systems, read results, or access real-time data.
If your goal is just to complete modeling and simulation using existing components, please read Platform User Guide first. The developer guide does not repeat common user processes such as canvas operations, parameter filling, and result analysis.
Choose a Development Path First
| Target | Starting Point | Minimum Verifiable Outcome |
|---|---|---|
| Extend workspace and component | Define Your First Workspace and Component | The new component appears in the specified Simulation Workbench and can be placed, connected, filled with parameters, and saved to the model |
| Access simulation kernel | Integrate Your First Simulation Kernel | A minimal job can be received and executed, and the platform can see the correct status, logs, and at least one result |
| Automation using the Python SDK | Run Your First Simulation with the Python SDK | The script completes the authentication, creates or reads the model, starts or queries the job, and obtains a verifiable result. |
| Call REST API and real-time results interface | Make Your First REST API Request | The external program completes authentication and a resource request, and correctly handles success and failure responses; when real-time results are needed, the connection and message reception are verified again. |
Four paths can be used in combination. For example, first extend the component and simulation kernel, and then use the SDK to write regression tests; you can also just call the API to integrate the existing simulation capabilities into the business system. It is recommended to complete the minimum results of a path first, and then expand the scope.
Understand System Boundaries
The main responsibilities of each module are as follows:
| Module | Main Responsibilities | Responsibilities That Should Not Be Assumed |
|---|---|---|
| Personal Center module | Login portal, and management portal for models, jobs, organizations, users, and workspaces | No simulation algorithm is executed |
| Simulation Workbench module | Edit models, create jobs, send control operations and display logs and results | It does not replace the platform server to save permissions and job status, nor does it directly connect to computing nodes. |
| Platform server | Authentication and authorization, resource persistence, job snapshots, job scheduling and real-time result forwarding | Does not implement industry-specific algorithms |
| component editor | Define component appearance, parameters, ports, directives, and global parameters | Not responsible for running the user model |
| simulation kernel or compute node | Read job input, perform calculations, process control instructions and return status and results | Do not directly modify the user model and permissions in the platform |
| System operation and maintenance module | Management services, compute nodes, versions and installation packages | Does not replace model and algorithm verification on the business side |
SDK and common business integration work through the interface provided by the platform server; platform maintenance integration only calls the maintenance interface exposed by the system operation and maintenance module. Neither type of integration should bypass public interfaces by directly reading and writing internal storage or assembling private requests to compute nodes. This preserves permission checks, job snapshots, status logging, and version compatibility.
If you need to further understand the call chain, please read Platform Architecture first; if you need to understand why the model forms a snapshot when creating a job and what the impact of subsequent modifications will be, please read Model, Job, Result, and Snapshot Lifecycles.
Prerequisite Concepts Common to All Development Paths
Resources and Identity
Workspaces, models, jobs, job snapshots, calculation instances, and result records often appear at the same time during development. They have different identities and life cycles and cannot be substituted for each other just because they have similar names. Please read Resource Identifiers before starting coding.
Authentication and Permissions
Being able to log in to the platform does not mean that you can access all workspaces, models or management interfaces. Organizational relationships, resource ownership, and operation types all participate in authorization judgments. SDK and API calls must also use the caller's own permissions. Do not use shared high-privilege accounts to bypass inspections. See Authentication and Permissions for the complete bounds.
Snapshot vs. Current Definition
Models are resources that can be edited continuously; jobs use the model state and definitions saved when they were created. Modifying components, global parameters or models should not retroactively overwrite already created jobs. When developing compatibility processing, it is necessary to clarify whether the test object is the "current model" or a "snapshot of a certain job".
Status and Errors
Job status, control operations, and error messages need to be understood consistently by each module. Don’t guess whether a job is over based on button text or a single log entry. Please refer to Status and Error Reference during development and troubleshooting.
Path Three: Automation Using Python SDK
This path is suitable for batch modeling, parameter sweeps, automated runs, results processing, and regression testing.
It is recommended to read in the following order:
- Complete Run Your First Simulation with the Python SDK.
- Read Install and Authenticate the Python SDK and separate the connection address and credentials from the script logic.
- Use Read, Edit, and Save Models with the SDK to create, read, and modify models.
- Use Run Jobs and Read Results with the SDK to start the job, wait for the state, and read the results.
- Read Batch Automation and Error Handling before batch running, and complete timeout, retry, cleanup and partial failure handling.
The minimum acceptance of this path is: the script completes authentication within the permissions of the test account, clearly identifies the workspace and model of the operation, executes a repeatable model or job process, obtains results, and returns diagnostic information in case of exceptions. When the script is run again, it should not leave an undiagnosable state due to repeated creation, infinite waiting, or missed cleanup.
The SDK encapsulates common resource operations without bypassing platform permissions, data verification, and job life cycles. When you need capabilities that are not yet encapsulated by the SDK, go to the REST API documentation and do not call internal interfaces or directly operate platform storage.
Path 4: Call REST API and Real-Time Result Interface
This path is suitable for integrating NexusFlow into portals, business systems, scheduling platforms, or other programming language environments.
It is recommended to read in the following order:
- Complete Make Your First REST API Request.
- Read API Conventions and Authentication and Token Refresh to unify address, request, paging, time and error response.
- Select User and Organization APIs, Workspace and Component Definition APIs, Model and Snapshot APIs or Job, Control, and Result APIs according to the business scope.
- When you need to continuously receive running data, read Real-Time Job Data Over WebSocket and design disconnection, reconnection and repeated message processing.
- Platform Operations APIs is only required for platform maintenance integration, and high-privilege credentials should be controlled separately.
The minimum acceptance of this path is: the external program uses a restricted test account to complete the authentication, issue a request with a clear business purpose, and correctly parse success and failure responses; if real-time results are accessed, the message should be assigned to the correct job, and repeated processing should be avoided after disconnection and reconnection.
Requests that modify the status cannot be blindly retried as read-only requests. For operations such as creating jobs, stopping jobs, deleting resources, and installing update packages, you must first confirm whether the request has been accepted by the server before deciding whether to retry.
Suggested Common Reading Order
If you are participating in NexusFlow development for the first time, it is recommended to follow the following sequence:
- Read Platform Architecture and Model, Job, Result, and Snapshot Lifecycles.
- Read Resource Identifiers and Authentication and Permissions.
- Choose an article to get started quickly and only complete a minimum closed loop.
- Read the special documents of the selected path and complete the data format, status, exceptions and release process.
- Use Data Schema Index to find specific structures without guessing fields on the overview page.
- Read Compatibility and Upgrade Guide before release and complete the regression verification of old models, old jobs or old callers.
When encountering a problem, first determine whether the fault is in definition, model, job scheduling, calculation execution, or result display, and then enter the corresponding chapter. Don't modify all modules at the same time from the beginning.
Security and Compatibility Principles
Use Least Privilege
- Use separate accounts for development, automation, and platform maintenance, and do not share super administrator accounts.
- Credentials, access tokens, and connection information must not be written to samples, logs, screenshots, or repositories.
- The visibility of workspace, models and jobs is ultimately determined by the server. Whether the front-end displays buttons cannot replace permission verification.
Maintain Interface Boundaries
- The SDK and external systems only call the interfaces in the public documentation.
- The simulation kernel only consumes the input assigned to the current job and returns data through the agreed channel.
- Do not directly modify the platform database, internal cache, or the running directory of other jobs.
Prioritize Backward Compatibility
- Component identifiers, ports, parameters, and result structures should be considered stable contracts once used by a model or caller.
- Adding optional content is usually safer than deleting or renaming it; breaking changes require release notes, migration plans, and fallback paths.
- Recipients should treat unknown fields and new states as documented and not treat the current example as the only possible structure.
Verify with Minimum Closed Loop
- First verify in the test organization and test workspace, do not directly use the production model for trial and error.
- Also verify paths such as success, failure, timeout, stop, and disconnection.
- Record the compatibility range and version before release, and re-complete the process from model to result from the perspective of ordinary users after release.
Please refer to Data Schema Index and Compatibility and Upgrade Guide for specific status, structure and compatibility rules. Instructions in the topic pages take precedence over old examples or historical implementations.