Software & practice

Connect Windows applications to existing workflows

An actual Windows roundtrip with a fixed helper and explicit boundaries between launch, valid response and business correctness.

A black application module and a red glass helper module are connected through two bounded glass guides. One is labelled JSON.

A new Windows application rarely works in isolation. It may need to receive existing information, extend an established program or return results to a familiar workflow. The first difficult question is not which interface looks more modern. It is which operation is actually being handed over and how both programs recognize completion. Starting a process does not establish that an assignment has been completed.

This guide develops a bounded integration through a complete executed example. A fixed helper process counts positions and quantities in a fictional JSON request. Input, output and waiting time have explicit limits. The evidence contains 51 executed checks on Windows using Node 24.22.1. No customer software was operated and no inventory was changed. Sources were checked on November 9, 2026. This demonstrates a process boundary rather than a general business software integration.

Understand the existing operation

Start by describing who receives which information and when. Someone may currently export a list, open it in another program and check its total. The actual objective may be to make that handover more dependable. Replacing the entire existing application is not necessarily required. A precisely bounded addition can be easier to assess than a broad redesign with no clear acceptance condition. Preserve the useful operational knowledge already present in the workflow.

Record the trigger, input, responsible program and expected result. Add the visible completion state: has a file been provided, a preview generated or a change actually committed? These states must remain separate. Established workflows often contain an implicit human review step. If it will disappear, identify and replace its professional function explicitly. A new button does not take over that responsibility simply because it combines several clicks.

Collect practical exceptions too. A source file may still be open, an export may be empty or a target program may not be installed. These belong in the requirements rather than only in later troubleshooting. A useful integration states what is preserved and how the person can proceed in each case. Avoid a successful completion message when the implementation merely attempted to start another program.

Choose an appropriate handover route

The Microsoft overview of interprocess communication describes different mechanisms for cooperation between programs. The appropriate choice depends on the exchange. A file export, a one-off helper process and a continuously available interface address different needs. Establish direction, duration and acknowledgement before adopting a complex communication architecture. The most elaborate option is not automatically the best fit for an existing operation.

RouteSuitable starting pointAcceptance question
File with a documented formatA discrete import or exportWho establishes completeness and errors?
Fixed command-line programBounded machine processingHow are output and termination assessed?
Documented application interfaceSpecific business functionsWhich permissions and version rules apply?
URI opening another applicationA deliberate switch to another interfaceIs launch or an actual outcome acknowledged?

The Windows guidance for URI launches concerns a different route from a fixed child process. Registered associations and the person's choices can affect which application opens. Such a launch is not an arbitrary background interface guaranteeing a business result. Our example registers no URI scheme and changes no default application. This distinction prevents successful navigation from being mistaken for completed processing.

Assess an existing documented interface against its own contract. Determine the functions actually offered and which response acknowledges completion. A web interface alone does not establish an automated business API. Similarly, a visible data field is not automatically a stable extraction interface. Base the decision on the intended integration facilities of the actual product and identify the supported version rather than assuming that every program exposes equivalent capabilities.

A small contract for an inspectable example

The request contains exactly one format version and a list of positions. Each position has an identifier and an integer quantity. The result reports the position count and total quantity. These are fictional test values. There is no inventory posting or reservation. Duplicate identifiers are not merged: two positions remain two positions. This small business rule matters because technically correct counting must not be presented as a count of distinct products.

JSON defines an interchange format, not the business meaning of these fields. RFC 8259 covers encoding and possible implementation limits. Our own contract requires UTF-8, particular properties and bounded quantities. A syntactically valid JSON text can still represent an invalid request. Validate the domain content independently after parsing. The same discipline applies when a future adapter reads an export produced by another application.

The limits are example decisions: up to 100 positions, quantities between one and 10,000 and input no larger than 32 KiB. They are not general Windows limits. A real product must derive appropriate values from its task. An unlimited list does not necessarily provide useful flexibility if it blocks the intended operation. Conversely, an overly narrow boundary should not silently truncate valid work. Reject an unsupported request explicitly and preserve an understandable next step.

The complete business function

The summary function remains independent of process creation. Its format and arithmetic can therefore be checked without launching another application. Unknown properties are rejected. Identifiers follow an explicitly selected simple pattern. That pattern is not a universal rule for stock codes. It bounds the demonstration data and documented processing step. Other datasets need a deliberate contract change, not an undocumented relaxation that makes old acceptance cases less meaningful.

export function summarize(job) {
  if (!job || Array.isArray(job) || typeof job !== 'object' ||
      Object.keys(job).sort().join(',') !== 'items,version' || job.version !== 1 ||
      !Array.isArray(job.items) || job.items.length < 1 || job.items.length > 100) throw new TypeError('Ungültiger Auftrag.');
  let totalQuantity = 0;
  for (const item of job.items) {
    if (!item || Array.isArray(item) || typeof item !== 'object' ||
        Object.keys(item).sort().join(',') !== 'quantity,sku' ||
        typeof item.sku !== 'string' || !/^[A-Z][A-Z0-9-]{0,19}$/.test(item.sku) ||
        !Number.isSafeInteger(item.quantity) || item.quantity < 1 || item.quantity > 10000) throw new TypeError('Ungültige Position.');
    totalQuantity += item.quantity;
  }
  return {version:1,itemCount:job.items.length,totalQuantity};
}

The total remains within the integer bounds established here. The function needs no database and calls no service. That does not describe a later adapter for real inventory. Such an adapter must determine the data revision being read and whether anything changes. Keep the business function separate from selection, interface and transport where possible. The separation shows which evidence covers which component instead of letting one successful process run stand for every requirement.

The complete helper process

The helper reads standard input until its end. It rejects excessive input and explicitly decodes bytes as UTF-8. It then invokes the business function. Successful standard output contains only the JSON result. A readable failure message goes to the separate error stream. This avoids accidentally treating diagnostics as part of a machine-readable answer. The distinction also makes a subsequent adapter easier to test with intentionally malformed responses.

import {summarize} from './summary.mjs';
try {
  const chunks = [];
  let bytes = 0;
  for await (const chunk of process.stdin) {
    bytes += chunk.length;
    if (bytes > 32768) throw new TypeError('Eingabe zu groß.');
    chunks.push(chunk);
  }
  const text = new TextDecoder('utf-8', {fatal:true}).decode(Buffer.concat(chunks));
  const result = summarize(JSON.parse(text));
  process.stdout.write(JSON.stringify(result) + '\n');
} catch {
  process.stderr.write('Auftrag konnte nicht verarbeitet werden.\n');
  process.exitCode = 2;
}

This helper is trusted software supplied as part of the application. It is not an execution environment for arbitrary programs. Receiving data through a pipe does not remove a child process's operating system rights. A substituted executable could attempt other actions. Distribution of the executable resources and protection from unintended replacement therefore remain separate prerequisites. Input and timing limits do not substitute for an appropriate security architecture.

The complete process bridge

The bridge launches the current Node executable with a fixed module path. Configuration remains separate from request data. The request cannot choose a program or add startup arguments. The documentation for the Node version actually used describes direct execution through execFile. Our flow explicitly uses no shell and starts no batch file. It does not build a command string from the business data.

import {execFile} from 'node:child_process';
import {isAbsolute, dirname} from 'node:path';
export class BridgeError extends Error {
  constructor(kind) { super(kind); this.name = 'BridgeError'; this.kind = kind; }
}
export function createRunner({workerPath, temporaryDirectory, timeoutMs = 2000}) {
  if (typeof workerPath !== 'string' || !isAbsolute(workerPath) || !workerPath.endsWith('.mjs') ||
      typeof temporaryDirectory !== 'string' || !isAbsolute(temporaryDirectory) ||
      !Number.isSafeInteger(timeoutMs) || timeoutMs < 20 || timeoutMs > 5000) throw new TypeError('Ungültige feste Konfiguration.');
  return async function run(job) {
    const text = JSON.stringify(job);
    if (typeof text !== 'string' || Buffer.byteLength(text, 'utf8') > 32768) throw new BridgeError('input_rejected');
    return new Promise((resolve, reject) => {
      let inputFailed = false;
      const child = execFile(process.execPath, [workerPath], {
        cwd: dirname(workerPath), shell:false, windowsHide:true, encoding:'utf8',
        timeout:timeoutMs, maxBuffer:8192,
        env:{SystemRoot:process.env.SystemRoot ?? '', TEMP:temporaryDirectory, TMP:temporaryDirectory}
      }, (error, stdout) => {
        if (error) {
          const kind = error.code === 'ERR_CHILD_PROCESS_STDIO_MAXBUFFER' ? 'output_limit' :
            error.killed ? 'timeout_or_termination' : 'process_failed';
          reject(new BridgeError(kind)); return;
        }
        if (inputFailed) { reject(new BridgeError('input_pipe_failed')); return; }
        try {
          const data = JSON.parse(stdout);
          if (!data || Array.isArray(data) || Object.keys(data).sort().join(',') !== 'itemCount,totalQuantity,version' ||
              data.version !== 1 || !Number.isSafeInteger(data.itemCount) || data.itemCount < 1 || data.itemCount > 100 ||
              !Number.isSafeInteger(data.totalQuantity) || data.totalQuantity < data.itemCount ||
              data.totalQuantity > data.itemCount * 10000) throw new Error('format');
          resolve(data);
        } catch { reject(new BridgeError('invalid_result')); }
      });
      child.stdin.on('error', () => { inputFailed = true; });
      child.stdin.end(text);
    });
  };
}

An absolute path is only a syntactic property. It does not establish that its target is trusted. The workerPath and temporary directory must come from reviewed application configuration, not from the request. The executed checks additionally use a trusted directory containing spaces. That exercises the actual launch route without manually assembling a command line or making a request-controlled executable path appear safe merely because it is absolute.

The default timeout is two seconds. The 8 KiB output bound applies separately to standard output or standard error, not to their combined total. These values fit the small demonstration and do not constitute a measured performance promise. Checked boundary failures are not counted as success. A timeout also does not mean a business operation was rolled back. A later integration involving writes must account for uncertainty about work already performed.

The environment includes only the values shown. This is not complete operating system isolation. Another helper may require additional environment entries. Add them deliberately rather than forwarding the parent's entire environment without review. In particular, logs should not automatically print secrets or full business payloads. The example's outward error categories are therefore concise. More detailed diagnostics can be retained where appropriate without confusing them with a successful domain response.

Run the complete example

Place the three modules and the following entry point in the same dedicated directory. The entry point creates the intended temporary subdirectory and assembles fixed configuration. It then submits a fictional two-position request. A suitable existing Node runtime is assumed. The executed record uses version 24.22.1 on Windows. This does not install or register a standalone graphical Windows application and does not claim to test a native application installer.

import {mkdir} from 'node:fs/promises';
import {fileURLToPath} from 'node:url';
import {join} from 'node:path';
import {createRunner} from './bridge.mjs';
const directory = fileURLToPath(new URL('.', import.meta.url));
const temporaryDirectory = join(directory, 'process-temp');
await mkdir(temporaryDirectory, {recursive:true});
const run = createRunner({workerPath:join(directory, 'worker.mjs'), temporaryDirectory});
const result = await run({version:1, items:[{sku:'A-01',quantity:2},{sku:'B-02',quantity:3}]});
console.log(JSON.stringify(result));

Run the entry point with node run-example.mjs. It returns two positions and a total quantity of five. This result actually passed through the child process; it is not a manually written success message. The example record also states the configured boundaries. Those details keep the arithmetic demonstration distinct from an inventory system integration. A real product adapter needs its own implementation and acceptance evidence.

{
  "input": {
    "version": 1,
    "items": [
      {
        "sku": "A-01",
        "quantity": 2
      },
      {
        "sku": "B-02",
        "quantity": 3
      }
    ]
  },
  "result": {
    "version": 1,
    "itemCount": 2,
    "totalQuantity": 5
  },
  "scope": "Actual local Windows Node child process. Fictional item quantities. No real inventory, customer software, external service or persistent booking.",
  "configuration": {
    "shell": false,
    "windowsHide": true,
    "inputBytes": 32768,
    "stdoutOrStderrBytes": 8192,
    "timeoutMs": 2000
  }
}
German-labelled application and helper exchange bounded JSON. The executed two-position request totals five. A separate fault process returns a structurally valid but incorrect total of six.
The explanation follows the actual Windows roundtrip and tested bounds. The additional total of six comes from a deliberate fault process. It demonstrates why structural validation and business correctness need separate evidence. 51 checks were executed. No customer application or inventory posting is involved.

What the 51 executed checks establish

The checks cover the independent function and actual Windows child processes. Cases include invalid requests, excessive position counts, invalid quantities and the maximum allowed sum. Separate fault processes emit unreadable JSON, additional properties, impossible count bounds or excessive output. A waiting process triggers the timeout. These counterexamples were actually executed rather than merely suggested as tests someone might write in the future.

One fault process intentionally returns a plausible but wrong total: six for quantities two and three. Its response satisfies the structural contract, so the bridge accepts its shape. This counterexample establishes that format validation alone does not prove business correctness. The real summary function is checked separately against its expected results. A more complex business operation needs correspondingly meaningful evidence instead of treating a successful parser as an independent mathematical verifier.

This record changes no registry values, operates no customer application and contacts no external service. It does not test an arbitrary process tree or guarantee reversal of every possible side effect of unknown software. The fault processes belong to the controlled test fixture. Describe those boundaries as precisely as the successful cases when applying the pattern to a real product. Otherwise a transport demonstration can look like a complete operational acceptance test.

Handle errors and retries as business states

A process that cannot start, an invalid response and a domain-rejected request are different conditions. Give each an appropriate next action. A missing program may need installation verification. An invalid record needs correction. Repeating the same launch does not automatically solve either cause. The interface should offer a meaningful action rather than hide every failure behind the same retry button. Retain enough context to explain which request remains unresolved.

Writing integrations introduce another important question: could the operation have partially completed even though no response arrived? This reading example performs no such posting. A real target could already have saved data. Retrying then requires protection against unintended duplicate processing and a route to determine the actual state. An expired waiting period is not evidence that nothing happened at the other end. Keep unknown completion distinct from confirmed refusal.

For those workflows, record a request identifier, adapter revision and observed states. Choose an identifier independently of sensitive contents. Correlation does not automatically require retaining an entire personal dataset. A useful log can distinguish accepted, started, responded and professionally accepted outcomes. Those stages provide more information than one line recording only that the caller stopped waiting. They also help the next operator decide whether repeating the request is appropriate.

Accept the integration in everyday use

Work with the people using the operation to determine which acknowledgement they need before proceeding. A mathematically correct total may still be insufficient if it is not associated with the selected request. A successful transfer can be unhelpful if the result appears in an unexpected location. Acceptance therefore connects the data contract, business meaning and understandable interaction. Include a failure path as well as the most convenient demonstration.

Record steps intentionally remaining outside the integration. A person may still approve an export or inspect a preview. That role should not accidentally be described as fully automated completion. Removing it later is a new business change. The same transport can then carry a different responsibility and need renewed acceptance. Keep the operational description aligned with the actual division of work rather than with an aspirational automation label.

Finally, identify who maintains the target-program assumptions. An update can preserve its window layout while changing an export, return code or available interface. Preserve the known working adapter and its fixture. When changing the integration, repeat the relevant failures before replacing the previous version. A short compatibility record describing the actual supported environment is more useful than an unexplained claim that the application connects to everything.

A release checklist

Keep a compact error catalogue tied to the implementation. These categories are example-specific rather than a general Windows standard. In particular, the timing category includes termination instead of claiming one uniquely diagnosed cause. Do not turn the adapter's limited observation into a more precise explanation invented by the interface.

CategoryObservationWhat it does not establish
input_rejectedThe bridge rejects the input.No business record is automatically committed.
process_failedThe helper did not finish successfully.The complete underlying cause is not identified.
output_limitA stream exceeded its bound.Truncated output is not an accepted partial result.
timeout_or_terminationWaiting or termination prevented success.A future writing adapter has not necessarily rolled back.
invalid_resultThe response violates its structural contract.Retrying does not automatically fix the format.

Also review concurrency before extending the example. Its function changes no shared inventory and writes no result file. A real adapter might target the same file or business resource from several requests. Successful individual process launches do not prevent conflicts between those requests. Assign a configuration owner, preserve known input-and-output examples and document semantic changes in a new contract version. A future version merging duplicate identifiers would change the meaning of position count even if its transport remained identical.

  • Describe the trigger, input and actual completion condition.
  • Inspect the target application's documented integration routes.
  • Separate executable configuration from request data.
  • Define format, version and business bounds explicitly.
  • Test byte and timing limits in both directions.
  • Keep diagnostics separate from machine-readable results.
  • Check structural validity and business correctness independently.
  • For writes, resolve retry and partial-completion behavior.
  • Preserve revisions, responsibility and meaningful logs.
  • Accept the real workflow in addition to the helper process.

A useful Windows integration extends an existing operation with an explicit contract. It does not infer completion merely from a successful process launch. The example provides an inspectable starting point: bounded input, a fixed program, separate channels and understandable results. The next step is the documented adapter for the actual target application, with that application's own business completion conditions and operational evidence.

Let’s move forward

What would you like to change?

An idea, a specific challenge or your next step with AI. We’re listening.

Let’s talk