CARVIEW |
Select Language
HTTP/2 200
date: Wed, 15 Oct 2025 23:43:48 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
etag: W/"67a27876ee82e03c2b6badee20e5bdf6"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com github.githubassets.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com wss://alive-staging.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com marketplace-screenshots.githubusercontent.com/ copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=40O8J0CAgULkEqG3XKt7ynqPXkTTrmGm0Xhr9tLvJZlfaFqkKEuGnrImgM%2FKRruipIWGEx5p4QpmdAjYWyFL3UImVfDAEYZA8rvJFSKORYf8GbesXiQhWk%2Fy1MwditnDMy4bvDGPQR%2B3UHpisMIzE7ez%2FwFWcFfeQZUmOUX%2F0RsLJ3bK0kyGKMZ0laIbeXUMsjDa8Emo9joqvupQ8nLhWJcTD7%2BwCY2%2FoRcPuH2yY3jSTO%2F46TQRTFg0hutenH458TEz6%2F%2BHRTEikUJD6hYkfw%3D%3D--9nQadqcSTiqKyrWq--aOfX7vFzNk0LuYf9OqjXrw%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.1623713718.1760571827; Path=/; Domain=github.com; Expires=Thu, 15 Oct 2026 23:43:47 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Thu, 15 Oct 2026 23:43:47 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: C048:38EEAB:6AA56:A5E62:68F031B3
Java Client · aelassas/wexflow Wiki · GitHub
Skip to content
Navigation Menu
{{ message }}
-
-
Notifications
You must be signed in to change notification settings - Fork 178
Java Client
Akram El Assas edited this page Jul 18, 2025
·
2 revisions
- Install Java JDK
Here is a sample Java client WexflowClient.java
:
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
public class WexflowClient {
private static final String BASE_URL = "https://localhost:8000/api/v1";
private static final String USERNAME = "admin";
private static final String PASSWORD = "wexflow2018";
private static final int WORKFLOW_ID = 41;
public static void main(String[] args) {
try {
String token = login(USERNAME, PASSWORD);
String jobId = startWorkflow(token, WORKFLOW_ID);
System.out.println("Workflow " + WORKFLOW_ID + " started successfully. Job ID: " + jobId);
} catch (Exception e) {
System.err.println("Error: " + e.getMessage());
e.printStackTrace();
}
}
private static String login(String username, String password) throws Exception {
URL url = new URL(BASE_URL + "/login");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("Content-Type", "application/json");
conn.setDoOutput(true);
String jsonInputString = String.format(
"{\"username\":\"%s\",\"password\":\"%s\",\"stayConnected\":false}",
username, password);
try (OutputStream os = conn.getOutputStream()) {
byte[] input = jsonInputString.getBytes("utf-8");
os.write(input);
}
int code = conn.getResponseCode();
if (code != 200) {
throw new RuntimeException("Login failed: HTTP " + code);
}
BufferedReader br = new BufferedReader(
new InputStreamReader(conn.getInputStream(), "utf-8"));
StringBuilder response = new StringBuilder();
String responseLine;
while ((responseLine = br.readLine()) != null) {
response.append(responseLine.trim());
}
// Response JSON format: { "access_token": "..." }
String json = response.toString();
String token = parseAccessToken(json);
if (token == null) {
throw new RuntimeException("No access_token found in response");
}
return token;
}
private static String startWorkflow(String token, int workflowId) throws Exception {
URL url = new URL(BASE_URL + "/start?w=" + workflowId);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("Authorization", "Bearer " + token);
conn.setDoOutput(true);
int code = conn.getResponseCode();
if (code != 200) {
throw new RuntimeException("Start workflow failed: HTTP " + code);
}
BufferedReader br = new BufferedReader(
new InputStreamReader(conn.getInputStream(), "utf-8"));
StringBuilder response = new StringBuilder();
String responseLine;
while ((responseLine = br.readLine()) != null) {
response.append(responseLine.trim());
}
return response.toString();
}
// Simple method to extract access_token from JSON response
private static String parseAccessToken(String json) {
// This is a naive parse, for production use a JSON library like Jackson or Gson
String tokenKey = "\"access_token\":\"";
int start = json.indexOf(tokenKey);
if (start == -1) return null;
start += tokenKey.length();
int end = json.indexOf("\"", start);
if (end == -1) return null;
return json.substring(start, end);
}
}
To run the client, use the following command:
javac WexflowClient.java
java WexflowClient
Copyright © Akram El Assas. All rights reserved.
- Install Guide
- HTTPS/SSL
- Screenshots
- Docker
- Configuration Guide
- Persistence Providers
- Getting Started
- Android App
- Local Variables
- Global Variables
- REST Variables
- Functions
- Cron Scheduling
- Command Line Interface (CLI)
- REST API Reference
- Samples
- Logging
- Custom Tasks
-
Built-in Tasks
- File system tasks
- Encryption tasks
- Compression tasks
- Iso tasks
- Speech tasks
- Hashing tasks
- Process tasks
- Network tasks
- XML tasks
- SQL tasks
- WMI tasks
- Image tasks
- Audio and video tasks
- Email tasks
- Workflow tasks
- Social media tasks
- Waitable tasks
- Reporting tasks
- Web tasks
- Script tasks
- JSON and YAML tasks
- Entities tasks
- Flowchart tasks
- Approval tasks
- Notification tasks
- SMS tasks
- Run from Source
- Fork, Customize, and Sync
Clone this wiki locally
You can’t perform that action at this time.