* make creator profile required
* fix grafana tag dropdown / outputs mismatch
* fix grafana annotations to make dashboard id required
* fix fal ai
* fix fal ai
* fix zep
* fix(tools): fix perplexity & parallel ai tag dropdown inaccuracies
* fixed stt, tts and added output conditions to conditionally display tag dropdown values based on other subblock values
* updated exa to match latest API
* fix(custom-bot-slack): dependsOn incorrectly set for bot_token"
* fix other references to be compatible
* fix dependsOn for things depending on authMethod"
* feat(tools): added rds tools/block
* feat(tools): added rds, dynamodb, background color gradient
* changed conditions for WHERE condition to be json conditions instead of raw string
* fix(team-plans): track departed member usage so value not lost
* reset usage to 0 when they leave team
* prep merge with stagig
* regen migrations
* fix org invite + ws selection'
---------
Co-authored-by: Waleed <walif6@gmail.com>
* feat(agent): added workflow, kb, and function as a tool for agent block
* fix keyboard nav and keyboard selection in tool-inp
* ack PR comments
* remove custom tool changes
* fixed kb tools for agent
* cleanup
* feat(tools): added speech to text with openai whisper, elevenlabs, and deepgram
* added new file icons, implemented ffmpeg
* updated docs
* revert environment
* added blacksmith optimizations to workflows and dockerfiles to enhance performance. please review before pushing to production
* remove cache from and cache to directives from docker based actions, per blacksmith docs
---------
Co-authored-by: Connor Mulholland <connormul@Connors-MacBook-Pro.local>
* fix(subflows): add loops/parallels to accessible list of blocks in the tag dropdown when contained withitn a subflow
* remove currentIteration in loop
* improvement(docs): remove copy page from mobile view on docs
* bring title and pagenav lower on mobile
* added cursor pointer to clickable components in docs
* fix(triggers): dedup + not surfacing deployment status log
* fix ms teams
* change to microsoftteams
* Revert "change to microsoftteams"
This reverts commit 217f808641.
* fix
* fix
* fix provider name
* fix oauth for msteams
* feat(billing): add notif for first failed payment, added upgrade email from free, updated providers that supported granular tool control to support them, fixed envvar popover, fixed redirect to wrong workspace after oauth connect
* fix build
* ack PR comments
* fix(custom-tools): updates to existing tools
* don't reorder custom tools in modal based on edit time
* restructure custom tools to persist copilot generated tools
* fix tests
* fix(templates): view current ui
* update UI to be less cluttered
* make state management for creating user profile smoother
* fix autoselect logic
* fix lint
* improvement(docs): added new platform ss
* rename approval to human in the loop
* cleanup
* remove yml
* removed other languages large sections
* fix icons
* Add helm for copilot
* Remove otel and log level
* Change repo name
* improvement(helm): enhance copilot chart with HA support and validation
* refactor(helm): consolidate copilot secrets and fix postgres volume mount
* feat(tools): added 10 new github triggers
* feat(tools): added 48 new github tools, 12 triggers
* fix(logging): make logging safe start an upsert to prevent insertions of duplicate execution id records, remove layout from github block
* feat(schedules): move schedule configuration out of modals into subblocks
* added more timezones
* added simple in-memory rate limiting to update schedule, validation on numeric values for date and time, fix update schedule behavior
* fix failing tests, ack PR comments
* surface better errors
* improvement(variables): add error context for duplicate variable names, only check for collision when focus is lost
* disallow empty variable names, performance optimizations
* safety guard against empty variables names
* feat(triggers): make triggers use existing subblock system, need to still fix webhook URL on multiselect and add script in text subblock for google form
* minimize added subblocks, cleanup code, make triggers first-class subblock users
* remove multi select dropdown and add props to existing dropdown instead
* cleanup dropdown
* add socket op to delete external webhook connections on block delete
* establish external webhook before creating webhook DB record, surface better errors for ones that require external connections
* fix copy button in short-input
* revert environment.ts, cleanup
* add triggers registry, update copilot tool to reflect new trigger setup
* update trigger-save subblock
* clean
* cleanup
* remove unused subblock store op, update search modal to reflect list of triggers
* add init from workflow to subblock store to populate new subblock format from old triggers
* fix mapping of old names to new ones
* added debug logging
* remove all extraneous debug logging and added mapping for triggerConfig field names that were changed
* fix trigger config for triggers w/ multiple triggers
* edge cases for effectiveTriggerId
* cleaned up
* fix dropdown multiselect
* fix multiselect
* updated short-input copy button
* duplicate blocks in trigger mode
* ack PR comments
* feat(cost): added hidden cost breakdown component to settings > subscription, start collecting current period copilot cost and last period copilot cost
* don't rerender envvars when switching between workflows in the same workspace
* feat(envvars): use cache for envvar dropdown key names, prevent autofill & suggestions in the settings
* add the same prevention for autocomplete and suggestions to sso and webhook
* fix(kb): fix mistral parse and kb uploads, include userId in internal auth
* update updated_at for kb when adding a new doc via knowledge block
* update tests
* Add variables block
* Add wait block
* While loop v1
* While loop v1
* Do while loops
* Copilot user input rerender fix
* Fix while and dowhile
* Vars block dropdown
* While loop docs
* Remove vars block coloring
* Fix lint
* Link docs to wait
* Fix build fail
* remove extraneous text from careers app
* feat(kb): added sort order to kb
* updated styles of workspace selector and delete button to match theme of rest of knowledgebase
* added google forms scope and google drive scope
* added back file scope
---------
Co-authored-by: Adam Gough <adamgough@Mac.attlocal.net>
Co-authored-by: Adam Gough <adamgough@Mac-530.lan>
* fix(dashboard): add additional context for paginated logs in dashboard, add empty state when selected cell has no data
* apps/sim
* renaming
* remove relative import
* feat(supabase): added vector search tool and updated docs
* exclude generic webhook from docs gen
* change items to pages in meta.json for tools directory in the docs
* feat(webhooks): added optioanl input format to webhooks, added support for file uploads
* feat(webhooks): added input format component to generic webhook trigger, added file support
* consolidated execution files utils, extended presigned URL duration for async tasks
* fix(input-format): allow value field to be cleared
* don't let value field be detected as deployment change
* fix zep icon in docs
* exclude collapsed state
* improvement(response-copilot): make it use builder mode over editor mode to prevent json formatting issues
* change placeholder text
* fix conversion between builder and editor mode
* fix(chat-subs): always use next public app url env
* use getBaseUrl everywhere
* move remaining uses
* fix test
* change auth.ts and make getBaseUrl() call not top level for emails
* change remaining uses
* revert csp
* cleanup
* fix
* feat(mistal): added mistral as a provider, updated model prices
* remove the ability for a block to reference its own outluts
* fixed order of responses for guardrails block
* fix(webhooks): use next public app url instead of request origin for webhook registration
* ack PR comments
* ci: pin Bun to v1.2.22 to avoid Bun 1.3 breaking changes
* feat(deployed-chat): updated chat panel UI, deployed chat and API can now accept files
* added nested tag dropdown for files
* added duplicate file validation to chat panel
* update docs & SDKs
* fixed build
* rm extraneous comments
* ack PR comments, cut multiple DB roundtrips for permissions & api key checks in api/workflows
* allow read-only users to access deployment info, but not take actions
* add downloadable file to logs for files passed in via API
* protect files/serve route that is only used client-side
---------
Co-authored-by: waleed <waleed>
* feat(billing): bill by threshold to prevent cancellation edge case
* fix org billing
* fix idempotency key issue
* small optimization for team checks
* remove console log
* remove unused type
* fix error handling
* feat(chat-stream): updated workflow id execute route to support streaming via API
* enable streaming via api
* added only text stream option
* cleanup deployed preview componnet
* updated selectedOutputIds to selectedOutput
* updated TS and Python SDKs with async, rate limits, usage, and streaming API routes
* stream non-streaming blocks when streaming is specified
* fix(chat-panel): add onBlockComplete handler to chat panel to stream back blocks as they complete
* update docs
* cleanup
* ack PR comments
* updated next config
* removed getAssetUrl in favor of local assets
* resolve merge conflicts
* remove extra logic to create sensitive result
* simplify internal auth
* remove vercel blob from CSP + next config
* fix: enable database connection pooling in production
* debug: add diagnostic endpoints to test NODE_ENV and database pooling
* test: add connection testing endpoint to diagnose production delay
* redeuce num of concurrent connections
* add state sending capability
* progress
* add ability to add title and description to workflow state
* progress in language
* fix
* cleanup code
* fix type issue
* fix subflow deletion case
* Workflow console tool
* fix lint
---------
Co-authored-by: Siddharth Ganesan <siddharthganesan@gmail.com>
* improvement(performance): remove writes to workflow updated_at on position updates for blocks, edges, & subflows
* update query pattern for logs routes
* improvement(var-resolution): resolve variables with block name check and consolidate code
* fix tests
* fix type error
* fix var highlighting in kb tags
* fix kb tags
* improvement(autolayout): use live block heights / widths for autolayout to prevent overlaps
* improve layering algo for multiple trigger setting
* remove console logs
* add type annotation
* feat(permissions): allow admin workspace users to deploy workflows in workspaces they don't own
* fixed failing test
* added additional routes
* remove overly complex, unecessary test and fixed docs formatting
* follow DRY
* first push pre testing
* toosl working
* progress
* bun run lint
* added doc
* changed google client ID and secret back
* cleaned up oauth
* removed comment
* removed any and added manual content
---------
Co-authored-by: Adam Gough <adamgough@Mac.attlocal.net>
* improvement(usage): bar execution if limits cannot be determined, init user stats record on user creation instead of in stripe plugin
* upsert user stats record in execution logger
* added add list items
(cherry picked from commit df6ea35d5bb975c03c7ec0c787bd915f34890ac0)
* bun run lint
* minor changes
---------
Co-authored-by: Adam Gough <adamgough@Mac.attlocal.net>
Co-authored-by: Adam Gough <adamgough@Adams-MacBook-Pro.local>
* update infra and remove railway
* feat(signup): added back to login functionalityfrom OTP page
* remove placeholders from docker commands, simplified login flow
* Revert "update infra and remove railway"
This reverts commit abfa2f8d51.
* improvement(code-structure): move db into separate package
* make db separate package
* remake bun lock
* update imports to not maintain two separate ones
* fix CI for tests by adding dummy url
* vercel build fix attempt
* update bun lock
* regenerate bun lock
* fix mocks
* remove db commands from apps/sim package json
* update infra and remove railway
* improvement(landing): insert prompt into copilot panel from landing, open panel on entry
* Revert "update infra and remove railway"
This reverts commit abfa2f8d51.
* fixes
* remove debug logs
* go back to old env
* update infra and remove railway
* feat(tools): add generic mail sending block/tools, updated docs script
* Revert "update infra and remove railway"
This reverts commit abfa2f8d51.
* remove message id
* updated type
* fix(migrations): downgrade nextjs
* fix(bun): pin bun version in db migrations
* Revert "fix(migrations): downgrade nextjs"
This reverts commit 27b544f22d.
* fix(stripe): use latest version to fix event mismatch issues
* fix enterprise handling
* cleanup
* update better auth version
* fix overage order of ops
* upgrade better auth version
* fix image typing
* change image type to string | undefined
* update infra and remove railway
* feat(webhooks): add idempotency service for all triggers/webhooks
* Revert "update infra and remove railway"
This reverts commit abfa2f8d51.
* cleanup
* ack PR comments
* update infra and remove railway
* feat(logs): added intelligent search to logs
* Revert "update infra and remove railway"
This reverts commit abfa2f8d51.
* cleanup
* cleanup
* update infra and remove railway
* feat(api-keys): add workspace-level api keys
* encrypt api keys
* Revert "update infra and remove railway"
This reverts commit b23258a5a1.
* reran migrations
* tested workspace keys
* consolidated code
* more consolidation
* cleanup
* consolidate, remove unused code
* add dummy key for ci
* continue with regular path for self-hosted folks that don't have key set
* fix tests
* fix test
* remove tests
* removed ci additions
* update infra and remove railway
* fix(file-upload): fix nextjs file upload issue with pdf-parse
* Revert "update infra and remove railway"
This reverts commit b23258a5a1.
* update infra and remove railway
* fix(kb): exclude deleted docs from queries
* Revert "update infra and remove railway"
This reverts commit b23258a5a1.
* update infra and remove railway
* overhaul docs
* added a lot more videos/examples to docs
* Revert "update infra and remove railway"
This reverts commit b23258a5a1.
* remove unused lines
* update start block docs
* update agent docs
* update API block docs
* update function block docs
* update response block docs
* update parallel and router docs
* update workflow docs
* update connections docs
* fix(sheets): fixed google sheets update (#1311)
Google sheets append was sending an invalid shape to the google sheets api. This PR fixes this by having similar logic to what is in append.ts
* fix(serializer): Required-field validation now respects sub-block visibility (#1313)
* audit content
* audit content
---------
Co-authored-by: Vikhyath Mondreti <vikhyath@simstudio.ai>
Co-authored-by: Adam Gough <77861281+aadamgough@users.noreply.github.com>
Co-authored-by: Vikhyath Mondreti <vikhyathvikku@gmail.com>
* update infra and remove railway
* fix(webooks-ui): made spacing more clear, added copy button for webhook URL & fixed race condition for mcp tools/server fetching in the mcp block
* Revert "update infra and remove railway"
This reverts commit 5a8876209d.
* remove extraneous comments
* ack PR comments
* update infra and remove railway
* feat(mcp): add mcp support
* consolidate mcp utils
* UI improvements, more MCP stuff
* cleanup placeholders
* reran migrations
* general improvements
* fix server side mcp exec
* more improvements, fixed search in environment settings tab
* persist subblock values for mcp block
* style fixes
* udpdate all text-primary to text-muted-foreground for visibility in dark mode
* Revert "update infra and remove railway"
This reverts commit dbf2b153b8f96808e7bb7e5f86f7e8624e3c12dd.
* make MCP servers workspace-scoped
* cleanup & remove unused dep
* consolidated utils, DRY
* added tests
* better error messages, confirmed that permissions works correctly
* additional improvements
* remove extraneous comments
* reran migrations
* lint
* style changes
* fix: prevent config mutation in MCP client URL retry logic
Fixed an issue where the MCP client was mutating the shared configuration
object's URL during retry attempts. This could cause configuration corruption
if the same config object was reused elsewhere.
* resolve PR comments
* ack PR comments
* update infra and remove railway
* feat(account): add profile pictures
* Revert "update infra and remove railway"
This reverts commit e3f0c49456.
* ack PR comments, use brandConfig logo URL as default
* update infra and remove railway
* fix(input-format): restore tag dropdown in input-format component
* Revert "update infra and remove railway"
This reverts commit 7ade5fb2ef.
* style improvements
* update infra and remove railway
* fix(notifications): increase precision on billing calculations
* Revert "update infra and remove railway"
This reverts commit d17603e844.
* cleanup
* fix(code-subblock): added validation to not parse non-variables as variables in the code subblock
* fix wand prompt bar styling
* fix error message for available connected blocks to only show connected available blocks, not block ID's
* ui
* fix(styling): fix unreadble text in dark mode
* fix styling inconsistencies in kb
* refetch permissions on invite modal open
---------
Co-authored-by: Vikhyath Mondreti <vikhyath@simstudio.ai>
* fix(ui): fix dark mode styling for switch, fix trigger modal UI
* auto-submit OTP when characters are entered
* trim leading and trailing whitespace from name on signup, throw more informative error messages on reset pass
* add parallel ai, postgres, mysql, slight modifications to dark mode styling
* bun install frozen lockfile
* new deps
* improve security, add wand to short input and update wand config
* fix(billing): team usage tracking cleanup, shared pool of limits for team
* address greptile commments
* fix lint
* remove usage of deprecated cols"
* update periodStart and periodEnd correctly
* fix lint
* fix type issue
* fix(billing): cleaned up billing, still more work to do on UI and population of data and consolidation
* fix upgrade
* cleanup
* progress
* works
* Remove 78th migration to prepare for merge with staging
* fix migration conflict
* remove useless test file
* fix
* Fix undefined seat pricing display and handle cancelled subscription seat updates
* cleanup code
* cleanup to use helpers for pulling pricing limits
* cleanup more things
* cleanup
* restore environment ts file
* remove unused files
* fix(team-management): fix team management UI, consolidate components
* use session data instead of subscription data in settings navigation
* remove unused code
* fix UI for enterprise plans
* added enterprise plan support
* progress
* billing state machine
* split overage and base into separate invoices
* fix badge logic
---------
Co-authored-by: waleedlatif1 <walif6@gmail.com>
* feat(integrations): added parallel ai block/tool and corresponding docs
* add postgres block
* added mysql block
* enrich docs for Postgres and MySQL
* make password fields user only for mysql and postgres
* fixed build
* ack greptile comments
* fix PR comments
* remove search_id from parallel ai
* fix parallel ai params
* fix(billing): vercel cron not processing billing periods
* fix(billing): cleanup unused POST and fix bug with billing timing check
* make subscriptions table source of truth for dates
* update org routes
* make everything dependent on stripe webhook
---------
Co-authored-by: Waleed Latif <walif6@gmail.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: Adam Gough <77861281+aadamgough@users.noreply.github.com>
Co-authored-by: Adam Gough <adamgough@Mac.attlocal.net>
* feat(native-bg-tasks): support webhooks and async workflow executions without trigger"
* fix tests
* fix env var defaults and revert async workflow execution to always use trigger
* fix UI for hiding async
* hide entire toggle
* telegram webhook fix
* changed payloads
* test
* test
* test
* test
* fix github dropdown
* test
* reverted github changes
* fixed github var
* test
* bun run lint
* test
* test
* test
* test
* test
* test
* test
* test
* test
* test
* test
* test
* test
* test
* test
* test
* test
* test
* test
* test
* test
* test
* test
* test
* test
* test push
* test
* bun run lint
* edited airtable payload and webhook deletion
* Revert bun.lock and package.json to upstream/staging
* cleaned up
* test
* test
* resolving more cmments
* resolved comments, updated trigger
* cleaned up, resolved comments
* test
* test
* lint
---------
Co-authored-by: Adam Gough <adamgough@Mac.attlocal.net>
* feat(templates): added in the ability to keep/remove templates when deleting workspace
* code cleanup in sidebar
* add the ability to edit existing templates
* updated template modal
* fix build
* revert bun.lock
* add template logic to workflow deletion as well
* add ability to delete templates
* add owner/admin enforcemnet to modify or delete templates
* fix: clear Docker build cache to use correct Next.js version
- Changed GitHub Actions cache scope from build-v2 to build-v3
- This should force a fresh build without cached Next.js 15.5.0 layers
- Reverted to ^15.3.2 version format that worked on main branch
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* run install
---------
Co-authored-by: Claude <noreply@anthropic.com>
* fix(gpt-5): fixed verbosity and reasoning parsm
* fixed dropdown
* default values for verbosity and reasoning effort
* cleanup
* use default value in dropdown
* feat(azure-openai): allow usage of azure-openai for knowledgebase uploads
* feat(azure-openai): added azure-openai for kb and wand
* added embeddings utils, added the ability to use mistral through Azure
* fix(oauth): gdrive picker race condition, token route cleanup
* fix test
* feat(mailer): consolidated all emailing to mailer service, added support for Azure ACS (#1054)
* feat(mailer): consolidated all emailing to mailer service, added support for Azure ACS
* fix batch invitation email template
* cleanup
* improvement(emails): add help template instead of doing it inline
* remove fallback version
---------
Co-authored-by: Vikhyath Mondreti <vikhyath@simstudio.ai>
* feat(mailer): consolidated all emailing to mailer service, added support for Azure ACS
* fix batch invitation email template
* cleanup
* improvement(emails): add help template instead of doing it inline
* improvement(serializer): filter out advanced mode fields when executing in basic mode, persist the values but don't include them in serialized block for execution
* fix serializer exclusion logic
* added logic to remove blocks from subflows
* refactored logic into just subflow-node
* bun run lint
* added subflow test
* added a safety check for data.parentId
* added state update logic
* bun run lint
* removed old logic
* removed any
* added tests
* added type safety
* removed test script
* type safety
---------
Co-authored-by: Adam Gough <adamgough@Mac.attlocal.net>
Co-authored-by: waleedlatif1 <walif6@gmail.com>
* improvement(redirects): move redirects to middleware, push to login if no session and workspace if session exists
* remove telemetry consent dialog
* remove migrations
* rerun migrations
* improvement(credentials-sharing-security): cleanup and reuse helper to determine credential access
* few more routes
* fix google sheets block
* fix test mocks
* fix calendar route
* fix(chunks): instantaneous search + server side searching instead of client-side
* add knowledge tags component to sidebar, replace old knowledge tags UI
* add types, remove extraneous comments
* added knowledge-base level tag definitions viewer, ability to create/delete slots in sidebar and respective routes
* ui
* fix stale tag issue
* use logger
* fix for variable format + trig
* fixed slack variable
* microsoft teams working
* fixed outlook, plus added other minor documentation changes and fixed subblock
* removed discord webhook logic
* added airtable logic
* bun run lint
* test
* test again
* test again 2
* test again 3
* test again 4
* test again 4
* test again 4
* bun run lint
* test 5
* test 6
* test 7
* test 7
* test 7
* test 7
* test 7
* test 7
* test 8
* test 9
* test 9
* test 9
* test 10
* test 10
* bun run lint, plus github fixed
* removed some debug statements #935
* testing resolver removing
* testing trig
---------
Co-authored-by: Adam Gough <adamgough@Adams-MacBook-Pro.local>
Co-authored-by: Adam Gough <adamgough@Mac.attlocal.net>
* feat(usage-indicator): added ability to see current usage
* feat(billing): added billing ennabled flag for usage indicator, enforcement of billing usage
---------
Co-authored-by: waleedlatif1 <walif6@gmail.com>
* standardized response format for transformError
* removed trasnformError, moved error handling to executeTool for all different error formats
* remove isInternalRoute, make it implicit in executeTool
* removed directExecution, everything on the server nothing on the client
* fix supabase
* fix(tag-dropdown): fix values for parallel & loop blocks (#929)
* fix(search-modal): add parallel and loop blocks to search modal
* reordered tool params
* update docs
* fix: same child workflow executing in parallel with workflow block
* fixed run button prematurely showing completion before child workflows completed
* prevent child worklfows from touching the activeBlocks & layer logic in the parent executor
* surface child workflow errors to main workfow
* ack PR comments
* feat(triggers): added new trigger mode for blocks, added socket event, ran migrations
* Rename old trigger/ directory to background/
* cleaned up, ensured that we display active webhook at the block-level
* fix submenu in tag dropdown
* keyboard nav on tag dropdown submenu
* feat(triggers): add outlook to new triggers system
* cleanup
* add types to tag dropdown, type all outputs for tools and use that over block outputs
* update doc generator to truly reflect outputs
* fix docs
* add trigger handler
* fix active webhook tag
* tag dropdown fix for triggers
* remove trigger mode schema change
* feat(execution-filesystem): system to pass files between blocks (#866)
* feat(files): pass files between blocks
* presigned URL for downloads
* Remove latest migration before merge
* starter block file upload wasn't getting logged
* checkpoint in human readable form
* checkpoint files / file type outputs
* file downloads working for block outputs
* checkpoint file download
* fix type issues
* remove filereference interface with simpler user file interface
* show files in the tag dropdown for start block
* more migration to simple url object, reduce presigned time to 5 min
* Remove migration 0065_parallel_nightmare and related files
- Deleted apps/sim/db/migrations/0065_parallel_nightmare.sql
- Deleted apps/sim/db/migrations/meta/0065_snapshot.json
- Removed 0065 entry from apps/sim/db/migrations/meta/_journal.json
Preparing for merge with origin/staging and migration regeneration
* add migration files
* fix tests
* Update apps/sim/lib/uploads/setup.ts
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* Update apps/sim/lib/workflows/execution-file-storage.ts
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* Update apps/sim/lib/workflows/execution-file-storage.ts
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* cleanup types
* fix lint
* fix logs typing for file refs
* open download in new tab
* fixed
* Update apps/sim/tools/index.ts
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* fix file block
* cleanup unused code
* fix bugs
* remove hacky file id logic
* fix drag and drop
* fix tests
---------
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* feat(trigger-mode): added trigger-mode to workflow_blocks table (#902)
* fix(schedules-perms): use regular perm system to view/edit schedule info (#901)
* fix(schedules-perms): use regular perm system to view schedule info
* fix perms
* improve logging
* cleanup
* prevent tooltip showing up on modal open
* updated trigger config
* fix type issues
---------
Co-authored-by: Vikhyath Mondreti <vikhyathvikku@gmail.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: Vikhyath Mondreti <vikhyath@simstudio.ai>
* feat(whitelabel): add in the ability to whitelabel via envvars
* restore site.webmanifest
* fix(dynamic): remove force-dynamic from routes that don't need it (#888)
* Reinstall dependencies
* Update docs
* Connects to s3
* Checkpoint
* File shows in message
* Make files clickable
* User input image
* Persist thumbnails
* Drag and drop files
* Lint
* Fix isdev
* Dont re-download files on rerender
* fix(kb-search): made query optional, so either query or tags or both can be provided
* cleanup
* added handlers, ensured that tag search done before vector search
* remove duplicate function
* fix(duplicate): added isWide and advacnedMode to optimistic duplicate, ensured it persists on client & server
* use collaborative set subblock value instead of doing it locally for collapsed subblocks
* cleamup
* fix(logs-page): optimize loading times by improving query, removing unused index, adding new index
* add migration files
* remove fake min loading time
* fix(sockets): add sockets event for tag / env var dropdown selections to be unit op
* do not bypass op queue for tag selections
* Update apps/sim/socket-server/handlers/subblocks.ts
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* prevent race cond between subblock update event and tag selection
* refactor
* reduce debounce time to 50ms
---------
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* fix(chat-deploy): added new image upload component, fixed some state issues with success view
* cleanup
---------
Co-authored-by: waleedlatif <waleedlatif@waleedlatifs-MacBook-Pro.local>
* feat(tools): added hunter.io tools/block, added default values of first option in dropdowns to avoid operation selector issue
* fix
* added description for all outputs, fixed param validation for tools
* cleanup
* add dual validation, once during serialization and once during execution
* improvement(docs): add base exec charge info to docs (#826)
* improvement(doc-tags-subblock): use table for doc tags subblock in create_document tool for KB (#827)
* improvement(doc-tags-subblock): use table for doc tags create doc tool in KB block
* enforce max tags
* remove red warning text
* fix(bugs): fixed rb2b csp, fixed overly-verbose logs, fixed x URLs (#828)
Co-authored-by: waleedlatif <waleedlatif@waleedlatifs-MacBook-Pro.local>
* fixed serialization errors to appear like execution errors, also fixed contrast on cmdk modal
* fixed required for tools, added tag dropdown for kb tags
* fix remaining tools with required fields
* update utils
* update docs
* fix kb tags
* fix types for exa
* lint
* updated contributing guide + pr template
* Test pre-commit hook with linting
* Test pre-commit hook again
* remove test files
* fixed wealthbox tool
* update telemetry endpoints
---------
Co-authored-by: waleedlatif <waleedlatif@waleedlatifs-MacBook-Pro.local>
Co-authored-by: Vikhyath Mondreti <vikhyathvikku@gmail.com>
* feat(domain): drop the
* change all references for Sim Studio to Sim
* change back license and notice
* lint
---------
Co-authored-by: waleedlatif <waleedlatif@waleedlatifs-MacBook-Pro.local>
* added CDN for large assets with fallback to static assets
* remove video assets from docs
---------
Co-authored-by: waleedlatif <waleedlatif@waleedlatifs-MacBook-Pro.local>
* feat: implement native ARM64 Docker builds with CDN support
- Replace QEMU emulation with native ARM64/AMD64 runners (linux-arm64-8-core, linux-x64-8-core)
- Fix manifest creation with proper error handling and image existence checks
- Add CDN video support with getVideoUrl function and Video component
- Update all docs MDX files to use Video component instead of raw video tags
- Update GitHub Actions workflow to use architecture-specific builds
- Remove QEMU setup to eliminate emulation timeout issues
- Maintain multi-arch Docker image support through manifests
* Update .github/workflows/build.yml
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
---------
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* feat: use 8-core self-hosted runner for faster Docker builds
* fix: lazy load large YAML prompt to prevent build memory exhaustion
- Convert YAML_WORKFLOW_PROMPT from static export to lazy function
- Prevents 281-line string literal from being loaded during static generation
- Fixes exit code 137 memory exhaustion during Docker builds
* fix(nextjs): add force dynamic for copilot routes to resolve OOM issue
* improvement(kb-perms): use workspace perms system for kbs
* readd test file
* fixed test
* address greptile comments
* fix button disabling logic
* update filter condition for legacy kbs
* fix kb selector to respect the workspace scoping
* remove testing code
* make workspace selection and prevent cascade deletion
* make workspace selector pass lint
* lint fixed
* fix type error
* added indexes to speed up logs loading time, modified to only display logs for current workspace
* remove user check, rely on source-of-truth permissions to display logs
* use getEnv on the client-side when we need to inject vars for docker runtime, fix folder container & removed folder/subfolder creation modals
* consolidated naming utils
* additional type safety
* checkpoint
* correctly clear status
* works
* improvements
* fix build issue
* add docs
* remove comments, logs
* fix migration to have foreign ref key
* change filename to snake case
* modified dropdown to match combobox styling
* added block type for triggers, split out schedule block into a separate trigger
* added chat trigger to start block, removed startAt from schedule modal, added chat fields into tag dropdown for start block
* removed startedAt for schedules, separated schedules into a separate block, removed unique constraint on scheule workflows and added combo constraint on workflowid/blockid and schedule
* icons fix
---------
Co-authored-by: Waleed Latif <walif6@gmail.com>
* improvement: workflow colors
* fix: workflow rename styling
* improvement: no API call on no name change workspace after edit
* improvement: added workflow and workspace to search
* improvement: folder path opened for current workflow on load
* improvement: ui/ux workspace selector
* improvement: search modal keyboard use
* added start block input fields to tag dropdown
* remove logs and workflowConnections from metadata for API triggered executions
* added field name validation for start block input to prevent JSON/API errors and user error
* fix response stringifcation, reuse input format from starter block for response format, add tag dropdown & connection block handling for response format
* hepler func for filteredResult
* fix response format w builder
* fix stringification of response handler
* expand fields by default
* cleanup
* feat(workspace): add ability to leave joined workspaces
* renamed workspaces/members/[id] to workspaces/members/[userId]
* revert name change for route
* fix(invitation): added ability for admins to remove members of their workspace
* lint
* remove references to workspace_member db table
* remove deprecated @next/font
* only allow admin to rename workspace
* bring workflow name change inline, remove dialog
* improvement: control bar
* improvement: debug flow
* improvement: control bar hovers and skeleton loading
* improvement: completed control bar
* improvement: panel tab selector complete
* refactor: deleted notifications and history dropdown
* improvement: chat UI complete
* fix: tab change on control bar run
* improvement: finshed console (audio display not working)
* fix: text wrapping in console content
* improvement: audio UI
* improvement: image display
* feat: add input to console
* improvement: code input and showing input on errors
* feat: download chat and console
* improvement: expandable panel and console visibility
* improvement: empty state UI
* improvement: finished variables
* fix: image in console entry
* improvement: sidebar and templates ui
* feat: uploading and fetching templates
* improvement: sidebar and control bar
* improvement: templates
* feat: templates done
* improvement: control bar
* improvement: debug flow
* improvement: control bar hovers and skeleton loading
* improvement: completed control bar
* improvement: panel tab selector complete
* refactor: deleted notifications and history dropdown
* improvement: chat UI complete
* fix: tab change on control bar run
* improvement: finshed console (audio display not working)
* fix: text wrapping in console content
* improvement: audio UI
* improvement: image display
* feat: add input to console
* improvement: code input and showing input on errors
* feat: download chat and console
* improvement: expandable panel and console visibility
* improvement: empty state UI
* improvement: finished variables
* fix: image in console entry
* improvement: sidebar and templates ui
* feat: uploading and fetching templates
* improvement: sidebar and control bar
* improvement: templates
* feat: templates done
* transfrom from block-centric tool input component to tool-centric tool input component for agent tools
* added additional type safety, created generic wrapper for tool input & reused across all subblock types
* stop retries if tool call fails, implemented for all providers except google
* bug fix with tool name extraction
* another bug fix
* ran script to update docs
* update contributing guide tool/block add example to reflect new param structure
* update README
* add key control to combobox, fixed google
* fixed google provider, fixed combobox
* fixed a ton of tools, ensured that the agent tool has full parity with actual tool for all tools
* update docs to reflect new structure
* updated visibility for gmail draft
* standardize dropdown values for tool definitions
* add asterisk for user-only + required fields
* updated visibility for tools
* consolidate redactApiKey util, fixed console entry bug that overwrites previous block logs
* updated docs
* update contributing guide to guide users to point their branches at staging instead of main
* nits
* move socket tests
* fix(sockets): added debouncing for sub-block values to prevent overloading socket server, fixed persistence issue during streaming back from LLM response format, removed unused events
* reuse existing isStreaming state for code block llm-generated response format
* force user to refresh on disconnect in order to mkae changes, add read-only offline mode
* remove unused hook
* style
* update tooltip msg
* remove unnecessary useMemo around log
* add response format structure to tag dropdown
* handle response format outputs for chat client and chat panel, implemented the response format handling for streamed responses
* cleanup
* fix(frozen canvas): don't error if workflow state not available for old logs
* fix lint
---------
Co-authored-by: Vikhyath Mondreti <vikhyathmondreti@vikhyaths-air.lan>
* feat(function): added more granular error logs for function execution for easier debugging (#593)
* added more granular error logs for function execution
* added tests
* fixed syntax error reporting
* feat(models): added temp controls for gpt-4.1 family of models (#594)
* improvement(knowledge-upload): create and upload document to KB (#579)
* improvement: added knowledge upload
* improvement: added greptile comments (#579)
* improvement: changed to text to doc (#579)
* improvement: removed comment (#579)
* added input validation, tested persistence of KB selector
* update docs
---------
Co-authored-by: Adam Gough <adamgough@Mac.attlocal.net>
Co-authored-by: Waleed Latif <walif6@gmail.com>
* fix(remove workflow.state usage): no more usage of deprecated state column in any routes (#586)
* fix(remove workflow.state usage): no more usage of deprecated state col in routes
* fix lint
* fix chat route to only use deployed state
* fix lint
* better typing
* remove useless logs
* fix lint
* restore workflow handler file
* removed all other usages of deprecated 'state' column from workflows table, updated tests
---------
Co-authored-by: Vikhyath Mondreti <vikhyathmondreti@Vikhyaths-MacBook-Air.local>
Co-authored-by: Waleed Latif <walif6@gmail.com>
---------
Co-authored-by: Waleed Latif <walif6@gmail.com>
Co-authored-by: Adam Gough <77861281+aadamgough@users.noreply.github.com>
Co-authored-by: Adam Gough <adamgough@Mac.attlocal.net>
Co-authored-by: Vikhyath Mondreti <vikhyathmondreti@Vikhyaths-MacBook-Air.local>
* fix(sockets): implement longer token expiration for OTT, preventitive token refresh with retries
* cleanup tests
* make websocket first choice transport
* fix lint
---------
Co-authored-by: Vikhyath Mondreti <vikhyathmondreti@vikhyaths-air.lan>
* feat: socket server for self/local deployment
* ci: memory limit and redundant dependency install
* chore: update readme, devcontainer, cli package
* chore: add new dev scripts and update README for full development setup
* finished barebones, optimized speech to speech chat deploy
* better visualization, interruption still not good
* fixed some turn detection, still not ideal. have to press mute + unmute to process successive queries
* improvements
* removed MediaSource in favor of blob, simplified echo cancellation and overall logic
* simplified
* cleanups
* ack PR comments
* added google calendar picker, tools, & block
* added attendees list to quick add for gcal
* added docs for gcal
* cleanup
* consolidated utils, additional type safety
* added pgvector image to docker builds, modified push to migrate to ameliorate vector data type issue
* added zod and t3-ss/env-nextjs to minimal set of dependencies for db image
* added healthcheck to docker services
* added block name and variable name validation to prevent invalid characters, fixed block renaming issue with drag handler
* also collapse multiple whitespaces into one
* got the read excel tool working
* added read manual ID insertion
* write working
* tool finished
* removed old logic
* removed logic that was causing credential error
* cleaned up
* ran bun lint
* removed logger
* added back merging logic
* fix: removed comments
* fix: added greptile changes
* ran bun lint
* removed function
* added microsoft excel docs
* fix: icon format
* fix: docs
* ran lint
---------
Co-authored-by: Adam Gough <adamgough@Adams-MacBook-Pro.local>
* feat(linear): add Linear Issue Reader and Writer tools with types
* chore(tools): register Linear tools in global tool registry
* feat(icons): add LinearIcon for Linear block
* feat(blocks): register Linear block in global block registry
* feat(linear): implement OAuth integration for Linear block
* feat(linear): add dynamic team and project selectors for Linear block
* feat(linear): add backend API endpoints for teams and projects
* feat(linear): update UI components for Linear selectors and modal
* refactor(linear): update create/read issue tools and types
* chore(linear): update block config for Linear integration
* fix(auth): update auth and oauth logic for Linear
* minor fix
* improvement[linear]: require teamId and projectId for all tools and types
* style[lint]: fix code style and lint errors
* chore(linear): install @linear/sdk package
* fix[linear]: address greptile-apps feedback for type safety and error handling
* fix[linear]: handle teams API response errors
* modified icon, added docs
---------
Co-authored-by: sriram2k4 <sriramthehacker01@gmail.com>
* added support for attachments in teams
* ran linter
* fixed small error
* run lint
* removed comments
---------
Co-authored-by: Adam Gough <adamgough@Adams-MacBook-Pro.local>
* feat: first round of tools for outlook
* added more
* outlook finished
* added bun and docs
* fix: added greptile comments
* added greptile and bun lint
* got rid of HTML
---------
Co-authored-by: Adam Gough <adamgough@Adams-MacBook-Pro.local>
* feat: microsoft teams block added
* updated name
* oauth working
* fixing accessToken
* saving accessToken spot
* all four tools are working
* display name better
* finished teams tool
* Remove package-lock.json from PR
* added greptile comments
* added scopes, removed ;, removed loggers
* solved credential bug
* added docs and rebased
* fixed lint checks
* more bun lint
* bun lint errors solved
---------
Co-authored-by: Adam Gough <adamgough@Adams-MacBook-Pro.local>
* fix: styling of tables, need to add pushing message to top
* message gets sent with some offset space
* fixed scroll
* updated styles, scrolling still messed up
* fixed rendering of tables, code. added copy, fixed error for settings sync, added additional formatting and styles to chat
* acknowledged PR comments
---------
Co-authored-by: Adam Gough <adamgough@Adams-MacBook-Pro.local>
* fixed deployment state
* fix: moved the deployment status logic to registry store
* removed head
* fix: changes detected for existing deployment
* fix: auto changes detected
* fix: rid of debugging
* fix: added greptile comments
* removed logic for change detection to hook to reduce load on control bar
---------
Co-authored-by: Adam Gough <adamgough@Adams-MacBook-Pro.local>
Co-authored-by: Adam Gough <adamgough@Mac.lan>
Co-authored-by: Waleed Latif <walif6@gmail.com>
* chore(docker): add OLLAMA_HOST environment variable to local and production configurations; update README for docker compose commands
* refactor(env): rename OLLAMA_HOST to OLLAMA_URL in configuration files and update related references
* added additional google drive tools
* added folder id and doc id fields for google docs and google drive, added additional google drive tools
* added google drive upload to list of google drive tools
* consolidated consts
* resolved PR comments
* removed waitlist on landing
* remove OTP in dev or docker, remove invite members from sidebar in dev/docker
* modified signup, login, verify, and reset password to match landing
* add README for npm package
* acknowledged PR comments
* restore cmd+enter functionality
* migrate to bun
* added envvars to drizzle
* upgrade bun devcontainer feature to a valid one
* added bun, docker not working
* updated envvars, updated to bunder and esnext modules
* fixed build, reinstated otel
* feat: optimized multi-stage docker images
* add coerce for boolean envvar
* feat: add docker-compose configuration for local LLM services and remove legacy Dockerfile and entrypoint script
* feat: add docker-compose files for local and production environments, and implement GitHub Actions for Docker image build and publish
* refactor: remove unused generateStaticParams function from various API routes and maintain dynamic rendering
* cleanup
* upgraded bun
* updated ci
* fixed build
---------
Co-authored-by: Aditya Tripathi <aditya@climactic.co>
* setup gmail polling service, not tested
* general improvements to gmail polling and error handling, receive message but triggers wrong wrokflow
* finished gmail polling service, works when I send multiple emails in a single polling period (triggers the workflow for each new email)
* remove unread messages
* remove unread messages
* modified to process all incoming emails as individual workflow executions, enhance dedupe, general improvements
* replaced desc w tooltips
* added cron job for polling gmail
* remove unused props, simplify naming convention
* renoved extraneous comments, removed unused processIncomingEmails
* fixed build issues
* acknowledged PR comments
* added turborepo
* finished turbo migration
* updated gitignore
* use dotenv & run format
* fixed error in docs
* remove standalone deployment in prod
* fix ts error, remove ignore ts errors during build
* added formatter to the end of the docs generator
This directory contains configuration files for Visual Studio Code Dev Containers / GitHub Codespaces. Dev containers provide a consistent, isolated development environment for this project.
Development container configuration for VS Code Dev Containers and GitHub Codespaces.
## Contents
-`devcontainer.json` - The main configuration file that defines the development container settings
-`Dockerfile` - Defines the container image and development environment
-`docker-compose.yml` - Sets up the application and database containers
-`post-create.sh` - Script that runs when the container is created
-`.bashrc` - Custom shell configuration with helpful aliases
## Usage
### Prerequisites
## Prerequisites
- Visual Studio Code
- Docker installation:
-Docker Desktop (Windows/macOS)
- Docker Engine (Linux)
- VS Code Remote - Containers extension
- Docker Desktop or Podman Desktop
-VS Code Dev Containers extension
### Getting Started
## Getting Started
1. Open this project in Visual Studio Code
2.When prompted, click "Reopen in Container"
- Alternatively, press `F1` and select "Remote-Containers: Reopen in Container"
1. Open this project in VS Code
2.Click "Reopen in Container" when prompted (or press `F1` → "Dev Containers: Reopen in Container")
3. Wait for the container to build and initialize
4.The post-creation script will automatically:
4.Start developing with `sim-start`
- Install dependencies
- Set up environment variables
- Run database migrations
- Configure helpful aliases
The setup script will automatically install dependencies and run migrations.
5. Start the application with `sim-start` (alias for `npm run dev`)
## Development Commands
### Development Commands
### Running Services
The development environment includes these helpful aliases:
You have two options for running the development environment:
**Option 1: Run everything together (recommended for most development)**
```bash
sim-start # Runs both app and socket server using concurrently
```
**Option 2: Run services separately (useful for debugging individual services)**
- In the **app** container terminal: `sim-app` (starts Next.js app on port 3000)
- In the **realtime** container terminal: `sim-sockets` (starts socket server on port 3002)
### Other Commands
-`sim-start` - Start the development server
-`sim-migrate` - Push schema changes to the database
-`sim-generate` - Generate new migrations
-`sim-rebuild` - Build and start the production version
-`pgc` - Connect to the PostgreSQL database
-`check-db` - List all databases
### Using GitHub Codespaces
This project is also configured for GitHub Codespaces. To use it:
1. Go to the GitHub repository
2. Click the "Code" button
3. Select the "Codespaces" tab
4. Click "Create codespace on main"
This will start a new Codespace with the development environment already set up.
## Customization
You can customize the development environment by:
- Modifying `devcontainer.json` to add VS Code extensions or settings
- Updating the `Dockerfile` to install additional packages
- Editing `docker-compose.yml` to add services or change configuration
- Modifying `.bashrc` to add custom aliases or configurations
-`build` - Build the application
-`pgc` - Connect to PostgreSQL database
## Troubleshooting
If you encounter issues:
**Build errors**: Rebuild the container with `F1` → "Dev Containers: Rebuild Container"
1. Rebuild the container: `F1` → "Remote-Containers: Rebuild Container"
2. Check Docker logs for build errors
3. Verify Docker Desktop is running
4. Ensure all prerequisites are installed
**Port conflicts**: Ensure ports 3000, 3002, and 5432 are available
For more information, see the [VS Code Remote Development documentation](https://code.visualstudio.com/docs/remote/containers).
**Container runtime issues**: Verify Docker Desktop or Podman Desktop is running
## Technical Details
Services:
- **App container** (8GB memory limit) - Main Next.js application
- **Realtime container** (4GB memory limit) - Socket.io server for real-time features
- **Database** - PostgreSQL with pgvector extension
- **Migrations** - Runs automatically on container creation
You can develop with services running together or independently.
### Personalization
**Project commands** (`sim-start`, `sim-app`, etc.) are automatically available via `/workspace/.devcontainer/sim-commands.sh`.
**Personal shell customization** (aliases, prompts, etc.) should use VS Code's dotfiles feature:
1. Create a dotfiles repository (e.g., `github.com/youruser/dotfiles`)
2. Add your `.bashrc`, `.zshrc`, or other configs
3. Configure in VS Code Settings:
```json
{
"dotfiles.repository": "youruser/dotfiles",
"dotfiles.installCommand": "install.sh"
}
```
This separates project-specific commands from personal preferences, following VS Code best practices.
Thank you for your interest in contributing to Sim Studio! Our goal is to provide developers with a powerful, user-friendly platform for building, testing, and optimizing agentic workflows. We welcome contributions in all forms—from bug fixes and design improvements to brand-new features.
Thank you for your interest in contributing to Sim! Our goal is to provide developers with a powerful, user-friendly platform for building, testing, and optimizing agentic workflows. We welcome contributions in all forms—from bug fixes and design improvements to brand-new features.
> **Project Overview:**
> Sim Studio is a monorepo containing the main application (`sim/`) and documentation (`docs/`). The main application is built with Next.js (app router), ReactFlow, Zustand, Shadcn, and Tailwind CSS. Please ensure your contributions follow our best practices for clarity, maintainability, and consistency.
> Sim is a monorepo using Turborepo, containing the main application (`apps/sim/`), documentation (`apps/docs/`), and shared packages (`packages/`). The main application is built with Next.js (app router), ReactFlow, Zustand, Shadcn, and Tailwind CSS. Please ensure your contributions follow our best practices for clarity, maintainability, and consistency.
---
@@ -15,8 +15,6 @@ Thank you for your interest in contributing to Sim Studio! Our goal is to provid
@@ -57,7 +55,7 @@ We strive to keep our workflow as simple as possible. To contribute:
```
7. **Create a Pull Request**
Open a pull request against the `main` branch on GitHub. Please provide a clear description of the changes and reference any relevant issues (e.g., `fixes #123`).
Open a pull request against the `staging` branch on GitHub. Please provide a clear description of the changes and reference any relevant issues (e.g., `fixes #123`).
---
@@ -85,7 +83,7 @@ If you discover a bug or have a feature request, please open an issue in our Git
Before creating a pull request:
- **Ensure Your Branch Is Up-to-Date:**
Rebase your branch onto the latest `main` branch to prevent merge conflicts.
Rebase your branch onto the latest `staging` branch to prevent merge conflicts.
- **Follow the Guidelines:**
Make sure your changes are well-tested, follow our coding standards, and include relevant documentation if necessary.
@@ -130,54 +128,73 @@ Using clear and consistent commit messages makes it easier for everyone to under
To set up your local development environment:
### Option 1: Using Docker (Recommended)
### Option 1: Using NPM Package (Simplest)
Docker provides a consistent development environment with all dependencies pre-configured.
The easiest way to run Sim locally is using our NPM package:
This command starts both the main application and the realtime socket server required for full functionality.
5. **Make Your Changes and Test Locally.**
### Email Template Development
@@ -248,7 +263,7 @@ When working on email templates, you can preview them using a local email previe
1. **Run the Email Preview Server:**
```bash
npm run email:dev
bun run email:dev
```
2. **Access the Preview:**
@@ -265,33 +280,33 @@ When working on email templates, you can preview them using a local email previe
## Adding New Blocks and Tools
Sim Studio is built in a modular fashion where blocks and tools extend the platform's functionality. To maintain consistency and quality, please follow the guidelines below when adding a new block or tool.
Sim is built in a modular fashion where blocks and tools extend the platform's functionality. To maintain consistency and quality, please follow the guidelines below when adding a new block or tool.
### Where to Add Your Code
- **Blocks:** Create your new block file under the `/sim/blocks/blocks` directory. The name of the file should match the provider name (e.g., `pinecone.ts`).
- **Tools:** Create a new directory under `/sim/tools` with the same name as the provider (e.g., `/sim/tools/pinecone`).
- **Blocks:** Create your new block file under the `/apps/sim/blocks/blocks` directory. The name of the file should match the provider name (e.g., `pinecone.ts`).
- **Tools:** Create a new directory under `/apps/sim/tools` with the same name as the provider (e.g., `/apps/sim/tools/pinecone`).
In addition, you will need to update the registries:
- **Block Registry:** Update the blocks index (`/sim/blocks/index.ts`) to include your new block.
- **Tool Registry:** Update the tools registry (`/sim/tools/index.ts`) to add your new tool.
- **Block Registry:** Update the blocks index (`/apps/sim/blocks/index.ts`) to include your new block.
- **Tool Registry:** Update the tools registry (`/apps/sim/tools/index.ts`) to add your new tool.
### How to Create a New Block
1. **Create a New File:**
Create a file for your block named after the provider (e.g., `pinecone.ts`) in the `/sim/blocks/blocks` directory.
Create a file for your block named after the provider (e.g., `pinecone.ts`) in the `/apps/sim/blocks/blocks` directory.
2. **Create a New Icon:**
Create a new icon for your block in the `/sim/components/icons.tsx` file. The icon should follow the same naming convention as the block (e.g., `PineconeIcon`).
Create a new icon for your block in the `/apps/sim/components/icons.tsx` file. The icon should follow the same naming convention as the block (e.g., `PineconeIcon`).
3. **Define the Block Configuration:**
Your block should export a constant of type `BlockConfig`. For example:
```typescript:/sim/blocks/blocks/pinecone.ts
```typescript:/apps/sim/blocks/blocks/pinecone.ts
import { PineconeIcon } from '@/components/icons'
import { PineconeResponse } from '@/tools/pinecone/types'
import { BlockConfig } from '../types'
import type { BlockConfig } from '@/blocks/types'
import type { PineconeResponse } from '@/tools/pinecone/types'
@@ -333,7 +391,7 @@ In addition, you will need to update the registries:
### How to Create a New Tool
1. **Create a New Directory:**
Create a directory under `/sim/tools` with the same name as the provider (e.g., `/sim/tools/pinecone`).
Create a directory under `/apps/sim/tools` with the same name as the provider (e.g., `/apps/sim/tools/pinecone`).
2. **Create Tool Files:**
Create separate files for each tool functionality with descriptive names (e.g., `fetch.ts`, `generate_embeddings.ts`, `search_text.ts`) in your tool directory.
@@ -344,7 +402,7 @@ In addition, you will need to update the registries:
4. **Create an Index File:**
Create an `index.ts` file in your tool directory that imports and exports all tools:
```typescript:/sim/tools/pinecone/index.ts
```typescript:/apps/sim/tools/pinecone/index.ts
import { fetchTool } from './fetch'
import { generateEmbeddingsTool } from './generate_embeddings'
import { searchTextTool } from './search_text'
@@ -355,9 +413,9 @@ In addition, you will need to update the registries:
5. **Define the Tool Configuration:**
Your tool should export a constant with a naming convention of `{toolName}Tool`. The tool ID should follow the format `{provider}_{tool_name}`. For example:
```typescript:/sim/tools/pinecone/fetch.ts
import { ToolConfig, ToolResponse } from '../types'
import { PineconeParams, PineconeResponse } from './types'
```typescript:/apps/sim/tools/pinecone/fetch.ts
import { ToolConfig, ToolResponse } from '@/tools/types'
import { PineconeParams, PineconeResponse } from '@/tools/pinecone/types'
@@ -401,6 +467,12 @@ In addition, you will need to update the registries:
7. **Test Your Tool:**
Ensure that your tool functions correctly by making test requests and verifying the responses.
8. **Generate Documentation:**
Run the documentation generator to create docs for your new tool:
```bash
./scripts/generate-docs.sh
```
### Naming Conventions
Maintaining consistent naming across the codebase is critical for auto-generation of tools and documentation. Follow these naming guidelines:
@@ -413,11 +485,57 @@ Maintaining consistent naming across the codebase is critical for auto-generatio
- **Tool Exports:** Should be named `{toolName}Tool` (e.g., `fetchTool`)
- **Tool IDs:** Should follow the format `{provider}_{tool_name}` (e.g., `pinecone_fetch`)
### Parameter Visibility System
Sim implements a sophisticated parameter visibility system that controls how parameters are exposed to users and LLMs in agent workflows. Each parameter can have one of four visibility levels:
| Visibility | User Sees | LLM Sees | How It Gets Set |
| `user-only` | ✅ Yes | ❌ No | User provides in UI |
| `user-or-llm` | ✅ Yes | ✅ Yes | User provides OR LLM generates |
| `llm-only` | ❌ No | ✅ Yes | LLM generates only |
| `hidden` | ❌ No | ❌ No | Application injects at runtime |
#### Visibility Guidelines
- **`user-or-llm`**: Use for core parameters that can be provided by users or intelligently filled by the LLM (e.g., search queries, email subjects)
- **`user-only`**: Use for configuration parameters, API keys, and settings that only users should control (e.g., number of results, authentication credentials)
- **`llm-only`**: Use for computed values that the LLM should handle internally (e.g., dynamic calculations, contextual data)
- **`hidden`**: Use for system-level parameters injected at runtime (e.g., OAuth tokens, internal identifiers)
#### Example Implementation
```typescript
params: {
query: {
type: 'string',
required: true,
visibility: 'user-or-llm', // User can provide or LLM can generate
description: 'Search query to execute',
},
apiKey: {
type: 'string',
required: true,
visibility: 'user-only', // Only user provides this
description: 'API key for authentication',
},
internalId: {
type: 'string',
required: false,
visibility: 'hidden', // System provides this at runtime
description: 'Internal tracking identifier',
},
}
```
This visibility system ensures clean user interfaces while maintaining full flexibility for LLM-driven workflows.
### Guidelines & Best Practices
- **Code Style:** Follow the project's ESLint and Prettier configurations. Use meaningful variable names and small, focused functions.
- **Code Style:** Follow the project's Biome configurations. Use meaningful variable names and small, focused functions.
- **Documentation:** Clearly document the purpose, inputs, outputs, and any special behavior for your block/tool.
- **Error Handling:** Implement robust error handling and provide user-friendly error messages.
- **Parameter Visibility:** Always specify the appropriate visibility level for each parameter to ensure proper UI behavior and LLM integration.
- **Testing:** Add unit or integration tests to verify your changes when possible.
- **Commit Changes:** Update all related components and registries, and describe your changes in your pull request.
@@ -435,7 +553,7 @@ This project is licensed under the Apache License 2.0. By contributing, you agre
By contributing to this repository, you agree that your contributions are provided under the terms of the Apache License Version 2.0, as included in the LICENSE file of this repository.
In addition, by submitting your contributions, you grant Sim Studio, Inc. ("The Licensor") a perpetual, irrevocable, worldwide, royalty-free, sublicensable right and license to:
In addition, by submitting your contributions, you grant Sim, Inc. ("The Licensor") a perpetual, irrevocable, worldwide, royalty-free, sublicensable right and license to:
- Use, copy, modify, distribute, publicly display, publicly perform, and prepare derivative works of your contributions.
- Incorporate your contributions into other works or products.
@@ -447,4 +565,4 @@ If you do not agree with these terms, you must not contribute your work to this
---
Thank you for taking the time to contribute to Sim Studio. We truly appreciate your efforts and look forward to collaborating with you!
Thank you for taking the time to contribute to Sim. We truly appreciate your efforts and look forward to collaborating with you!
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context.
Fixes #(issue)
Fixes # (issue)
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation
- [ ] Other: ___________
## Type of change
## Testing
How has this been tested? What should reviewers focus on?
Please delete options that are not relevant.
- [ ]Bug fix (non-breaking change which fixes an issue)
- [ ]New feature (non-breaking change which adds functionality)
- [ ]Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Documentation update
- [ ] Security enhancement
- [ ] Performance improvement
- [ ] Code refactoring (no functional changes)
## How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.
## Checklist:
- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] All tests pass locally and in CI (`npm test`)
- [ ] My changes generate no new warnings
- [ ] Any dependent changes have been merged and published in downstream modules
- [ ] I have updated version numbers as needed (if needed)
## Checklist
- [ ] Code follows project style guidelines
- [ ]Self-reviewed my changes
- [ ]Tests added/updated and passing
- [ ]No new warnings introduced
- [ ] I confirm that I have read and agree to the terms outlined in the [Contributor License Agreement (CLA)](./CONTRIBUTING.md#contributor-license-agreement-cla)
## Security Considerations:
- [ ] My changes do not introduce any new security vulnerabilities
- [ ] I have considered the security implications of my changes
## Additional Information:
Any additional information, configuration or data that might be necessary to reproduce the issue or use the feature.
## Screenshots/Videos
<!-- If applicable, add screenshots or videos to help explain your changes -->
<!-- For UI changes, before/after screenshots are especially helpful -->
if [ -n "$(git status --porcelain content/docs)" ]; then
echo "changes=true" >> $GITHUB_OUTPUT
else
echo "changes=false" >> $GITHUB_OUTPUT
fi
- name:Create Pull Request with translations
if:steps.changes.outputs.changes == 'true'
uses:peter-evans/create-pull-request@v5
with:
token:${{ secrets.GH_PAT }}
commit-message:"feat(i18n): update translations"
title:"feat(i18n): update translations"
body:|
## Summary
Automated translation updates triggered by changes to documentation.
This PR was automatically created after content changes were made, updating translations for all supported languages using Lingo.dev AI translation engine.
- [x] Self-reviewed my changes (automated process)
- [ ] Tests added/updated and passing
- [x] No new warnings introduced
- [x] I confirm that I have read and agree to the terms outlined in the [Contributor License Agreement (CLA)](./CONTRIBUTING.md#contributor-license-agreement-cla)
## Screenshots/Videos
<!-- Translation changes are text-based - no visual changes expected -->
<!-- Reviewers should check the documentation site renders correctly for all languages -->
See the [README](https://github.com/simstudioai/sim/tree/main/packages/python-sdk) or the [docs](https://docs.sim.ai/sdks/python) for more information.
See the [README](https://github.com/simstudioai/sim/tree/main/packages/ts-sdk) or the [docs](https://docs.sim.ai/sdks/typescript) for more information.
**You are tasked with implementing solutions that follow best practices. You MUST be accurate, elegant, and efficient as an expert programmer.**
---
# Role
You are a professional software engineer. All code you write MUST follow best practices, ensuring accuracy, quality, readability, and cleanliness. You MUST make FOCUSED EDITS that are EFFICIENT and ELEGANT.
## Logs
ENSURE that you use the logger.info and logger.warn and logger.error instead of the console.log whenever you want to display logs.
## Comments
You must use TSDOC for comments. Do not use ==== for comments to separate sections. Do not leave any comments that are not TSDOC.
## Global Styles
You should not update the global styles unless it is absolutely necessary. Keep all styling local to components and files.
## Bun
Use bun and bunx not npm and npx.
## Code Quality
- Write clean, maintainable code that follows the project's existing patterns
- Prefer composition over inheritance
- Keep functions small and focused on a single responsibility
- Use meaningful variable and function names
- Handle errors gracefully and provide useful error messages
- Write type-safe code with proper TypeScript types
## Testing
- Write tests for new functionality when appropriate
- Ensure existing tests pass before completing work
- Follow the project's testing conventions
## Performance
- Consider performance implications of your code
- Avoid unnecessary re-renders in React components
If you already have Ollama running on your host machine (outside Docker), you need to configure the `OLLAMA_URL` to use `host.docker.internal` instead of `localhost`:
```bash
# Push the database schema
npx drizzle-kit push
# Docker Desktop (macOS/Windows)
OLLAMA_URL=http://host.docker.internal:11434 docker compose -f docker-compose.prod.yml up -d
# Linux (add extra_hosts or use host IP)
docker compose -f docker-compose.prod.yml up -d # Then set OLLAMA_URL to your host's IP
```
4. **Start Development Server**
**Why?** When running inside Docker, `localhost` refers to the container itself, not your host machine. `host.docker.internal` is a special DNS name that resolves to the host.
For Linux users, you can either:
- Use your host machine's actual IP address (e.g., `http://192.168.1.100:11434`)
- Add `extra_hosts: ["host.docker.internal:host-gateway"]` to the simstudio service in your compose file
#### Using vLLM
Sim also supports [vLLM](https://docs.vllm.ai/) for self-hosted models with OpenAI-compatible API:
```bash
# Start the development server
npm run dev
# Set these environment variables
VLLM_BASE_URL=http://your-vllm-server:8000
VLLM_API_KEY=your_optional_api_key # Only if your vLLM instance requires auth
```
5.**Open [http://localhost:3000](http://localhost:3000) in your browser**
When running with Docker, use `host.docker.internal` if vLLM is on your host machine (same as Ollama above).
### Self-hosted: Dev Containers
1. Open VS Code with the [Remote - Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)
2. Open the project and click "Reopen in Container" when prompted
3. Run `bun run dev:full` in the terminal or use the `sim-start` alias
- This starts both the main application and the realtime socket server
### Self-hosted: Manual Setup
**Requirements:**
- [Bun](https://bun.sh/) runtime
- PostgreSQL 12+ with [pgvector extension](https://github.com/pgvector/pgvector) (required for AI embeddings)
**Note:** Sim uses vector embeddings for AI features like knowledge bases and semantic search, which requires the `pgvector` PostgreSQL extension.
1. Clone and install dependencies:
```bash
git clone https://github.com/simstudioai/sim.git
cd sim
bun install
```
2. Set up PostgreSQL with pgvector:
You need PostgreSQL with the `vector` extension for embedding support. Choose one option:
**Option A: Using Docker (Recommended)**
```bash
# Start PostgreSQL with pgvector extension
docker run --name simstudio-db \
-e POSTGRES_PASSWORD=your_password \
-e POSTGRES_DB=simstudio \
-p 5432:5432 -d \
pgvector/pgvector:pg17
```
**Option B: Manual Installation**
- Install PostgreSQL 12+ and the pgvector extension
- See [pgvector installation guide](https://github.com/pgvector/pgvector#installation)
default:'Sim Documentation - Visual Workflow Builder for AI Applications',
template:'%s',
},
description:
'Comprehensive documentation for Sim - the visual workflow builder for AI applications. Create powerful AI agents, automation workflows, and data processing pipelines by connecting blocks on a canvas—no coding required.',
title:'Sim Documentation - Visual Workflow Builder for AI Applications',
description:
'Comprehensive documentation for Sim - the visual workflow builder for AI applications. Create powerful AI agents, automation workflows, and data processing pipelines.',
},
twitter:{
card:'summary_large_image',
title:'Sim Documentation - Visual Workflow Builder for AI Applications',
description:
'Comprehensive documentation for Sim - the visual workflow builder for AI applications.',
Sim is a visual workflow builder for AI applications that lets you build AI agent workflows visually. Create powerful AI agents, automation workflows, and data processing pipelines by connecting blocks on a canvas—no coding required.
## Documentation Overview
This file provides an overview of our documentation. For full content of all pages, see ${baseUrl}/llms-full.txt
'Comprehensive documentation for Sim visual workflow builder for AI applications. Create powerful AI agents, automation workflows, and data processing pipelines.',
'Visual workflow builder for AI applications. Create powerful AI agents, automation workflows, and data processing pipelines by connecting blocks on a canvas—no coding required.',
url: baseUrl,
author:{
'@type':'Organization',
name:'Sim Team',
},
offers:{
'@type':'Offer',
category:'Developer Tools',
},
featureList:[
'Visual workflow builder with drag-and-drop interface',
import { Callout } from 'fumadocs-ui/components/callout'
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
import { Image } from '@/components/ui/image'
Der Agent-Block verbindet deinen Workflow mit Large Language Models (LLMs). Er verarbeitet natürlichsprachliche Eingaben, ruft externe Tools auf und generiert strukturierte oder unstrukturierte Ausgaben.
<div className="flex justify-center">
<Image
src="/static/blocks/agent.png"
alt="Agent-Block-Konfiguration"
width={500}
height={400}
className="my-6"
/>
</div>
## Konfigurationsoptionen
### System-Prompt
Der System-Prompt legt die Betriebsparameter und Verhaltenseinschränkungen des Agenten fest. Diese Konfiguration definiert die Rolle des Agenten, die Antwortmethodik und die Verarbeitungsgrenzen für alle eingehenden Anfragen.
```markdown
You are a helpful assistant that specializes in financial analysis.
Always provide clear explanations and cite sources when possible.
When responding to questions about investments, include risk disclaimers.
```
### Benutzer-Prompt
Der Benutzer-Prompt stellt die primären Eingabedaten für die Inferenzverarbeitung dar. Dieser Parameter akzeptiert natürlichsprachlichen Text oder strukturierte Daten, die der Agent analysieren und auf die er reagieren wird. Zu den Eingabequellen gehören:
- **Statische Konfiguration**: Direkte Texteingabe, die in der Block-Konfiguration angegeben ist
- **Dynamische Eingabe**: Daten, die von vorgelagerten Blöcken über Verbindungsschnittstellen übergeben werden
- **Laufzeitgenerierung**: Programmatisch generierte Inhalte während der Workflow-Ausführung
### Modellauswahl
Der Agent-Block unterstützt mehrere LLM-Anbieter über eine einheitliche Inferenzschnittstelle. Verfügbare Modelle umfassen:
- **Lokale Modelle**: Ollama oder VLLM-kompatible Modelle
### Temperatur
Steuert die Zufälligkeit und Kreativität der Antworten:
- **Niedrig (0-0,3)**: Deterministisch und fokussiert. Am besten für faktische Aufgaben und Genauigkeit.
- **Mittel (0,3-0,7)**: Ausgewogene Kreativität und Fokus. Gut für allgemeine Verwendung.
- **Hoch (0,7-2,0)**: Kreativ und abwechslungsreich. Ideal für Brainstorming und Content-Generierung.
### API-Schlüssel
Ihr API-Schlüssel für den ausgewählten LLM-Anbieter. Dieser wird sicher gespeichert und für die Authentifizierung verwendet.
### Tools
Erweitern Sie die Fähigkeiten des Agenten mit externen Integrationen. Wählen Sie aus über 60 vorgefertigten Tools oder definieren Sie benutzerdefinierte Funktionen.
**Verfügbare Kategorien:**
- **Kommunikation**: Gmail, Slack, Telegram, WhatsApp, Microsoft Teams
- **Datenquellen**: Notion, Google Sheets, Airtable, Supabase, Pinecone
- **Webdienste**: Firecrawl, Google Search, Exa AI, Browser-Automatisierung
- **Auto**: Modell entscheidet kontextbasiert, wann Tools verwendet werden
- **Erforderlich**: Tool muss bei jeder Anfrage aufgerufen werden
- **Keine**: Tool verfügbar, aber dem Modell nicht vorgeschlagen
### Antwortformat
Der Parameter für das Antwortformat erzwingt die Generierung strukturierter Ausgaben durch JSON-Schema-Validierung. Dies gewährleistet konsistente, maschinenlesbare Antworten, die vordefinierten Datenstrukturen entsprechen:
```json
{
"type": "object",
"properties": {
"sentiment": {
"type": "string",
"enum": ["positive", "neutral", "negative"]
},
"summary": {
"type": "string",
"description": "Brief summary of the content"
}
},
"required": ["sentiment", "summary"]
}
```
Diese Konfiguration beschränkt die Ausgabe des Modells auf die Einhaltung des angegebenen Schemas, verhindert Freitextantworten und stellt die Generierung strukturierter Daten sicher.
### Zugriff auf Ergebnisse
Nach Abschluss eines Agenten können Sie auf seine Ausgaben zugreifen:
- **response**: Der Antworttext oder die strukturierten Daten des Agenten
- **toolExecutions**: Details zu allen Tools, die der Agent während der Ausführung verwendet hat
- **estimatedCost**: Geschätzte Kosten des API-Aufrufs (falls verfügbar)
## Erweiterte Funktionen
### Memory + Agent: Gesprächsverlauf
Verwenden Sie einen memory Block mit einer konsistenten memoryId (zum Beispiel, conversationHistory), um Nachrichten zwischen Durchläufen zu speichern und diesen Verlauf in den Prompt des Agenten einzubeziehen.
- Fügen Sie die Nachricht des Benutzers vor dem Agenten hinzu
- Lesen Sie den Gesprächsverlauf für den Kontext
- Hängen Sie die Antwort des Agenten nach dessen Ausführung an
Siehe den [`Memory`](/tools/memory) Blockverweis für Details.
## Ausgaben
- **`<agent.content>`**: Antworttext des Agenten
- **`<agent.tokens>`**: Token-Nutzungsstatistiken
- **`<agent.tool_calls>`**: Details zur Tool-Ausführung
- **`<agent.cost>`**: Geschätzte Kosten des API-Aufrufs
## Beispielanwendungsfälle
**Automatisierung des Kundenservice** - Bearbeitung von Anfragen mit Datenbank- und Tool-Zugriff
**Multi-Modell-Inhaltsanalyse** - Analyse von Inhalten mit verschiedenen KI-Modellen
```
Function (Process) → Agent (GPT-4o Technical) → Agent (Claude Sentiment) → Function (Report)
```
**Tool-gestützter Rechercheassistent** - Recherche mit Websuche und Dokumentenzugriff
```
Input → Agent (Google Search, Notion) → Function (Compile Report)
```
## Bewährte Praktiken
- **Sei spezifisch in System-Prompts**: Definiere die Rolle, den Ton und die Einschränkungen des Agenten klar. Je spezifischer deine Anweisungen sind, desto besser kann der Agent seinen vorgesehenen Zweck erfüllen.
- **Wähle die richtige Temperatureinstellung**: Verwende niedrigere Temperatureinstellungen (0-0,3), wenn Genauigkeit wichtig ist, oder erhöhe die Temperatur (0,7-2,0) für kreativere oder vielfältigere Antworten
- **Nutze Tools effektiv**: Integriere Tools, die den Zweck des Agenten ergänzen und seine Fähigkeiten erweitern. Sei selektiv bei der Auswahl der Tools, um den Agenten nicht zu überfordern. Für Aufgaben mit wenig Überschneidung verwende einen anderen Agent-Block für die besten Ergebnisse.
import { Callout } from 'fumadocs-ui/components/callout'
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
import { Image } from '@/components/ui/image'
Der API-Block verbindet Ihren Workflow mit externen Diensten durch HTTP-Anfragen. Unterstützt GET, POST, PUT, DELETE und PATCH Methoden für die Interaktion mit REST-APIs.
<div className="flex justify-center">
<Image
src="/static/blocks/api.png"
alt="API-Block"
width={500}
height={400}
className="my-6"
/>
</div>
## Konfigurationsoptionen
### URL
Die Endpunkt-URL für die API-Anfrage. Diese kann sein:
- Eine statische URL, die direkt im Block eingegeben wird
- Eine dynamische URL, die mit der Ausgabe eines anderen Blocks verbunden ist
- Eine URL mit Pfadparametern
### Methode
Wählen Sie die HTTP-Methode für Ihre Anfrage:
- **GET**: Daten vom Server abrufen
- **POST**: Daten an den Server senden, um eine Ressource zu erstellen
- **PUT**: Eine bestehende Ressource auf dem Server aktualisieren
- **DELETE**: Eine Ressource vom Server entfernen
- **PATCH**: Eine bestehende Ressource teilweise aktualisieren
### Abfrageparameter
Definieren Sie Schlüssel-Wert-Paare, die als Abfrageparameter an die URL angehängt werden. Zum Beispiel:
```
Key: apiKey
Value: your_api_key_here
Key: limit
Value: 10
```
Diese würden der URL als `?apiKey=your_api_key_here&limit=10` hinzugefügt.
### Header
Konfigurieren Sie HTTP-Header für Ihre Anfrage. Häufige Header sind:
```
Key: Content-Type
Value: application/json
Key: Authorization
Value: Bearer your_token_here
```
### Anfragekörper
Für Methoden, die einen Anfragekörper unterstützen (POST, PUT, PATCH), können Sie die zu sendenden Daten definieren. Der Körper kann sein:
- JSON-Daten, die direkt im Block eingegeben werden
- Daten, die mit der Ausgabe eines anderen Blocks verbunden sind
- Dynamisch während der Workflow-Ausführung generiert
### Zugriff auf Ergebnisse
Nach Abschluss einer API-Anfrage können Sie auf folgende Ausgaben zugreifen:
import { Callout } from 'fumadocs-ui/components/callout'
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
import { Image } from '@/components/ui/image'
Der Bedingungsblock verzweigt die Workflow-Ausführung basierend auf booleschen Ausdrücken. Bewerten Sie Bedingungen anhand vorheriger Block-Ausgaben und leiten Sie zu verschiedenen Pfaden weiter, ohne dass ein LLM erforderlich ist.
<div className="flex justify-center">
<Image
src="/static/blocks/condition.png"
alt="Bedingungsblock"
width={500}
height={400}
className="my-6"
/>
</div>
## Konfigurationsoptionen
### Bedingungen
Definieren Sie eine oder mehrere Bedingungen, die ausgewertet werden. Jede Bedingung umfasst:
- **Ausdruck**: Ein JavaScript/TypeScript-Ausdruck, der zu wahr oder falsch ausgewertet wird
- **Pfad**: Der Zielblock, zu dem weitergeleitet werden soll, wenn die Bedingung wahr ist
- **Beschreibung**: Optionale Erklärung, was die Bedingung prüft
Sie können mehrere Bedingungen erstellen, die der Reihe nach ausgewertet werden, wobei die erste übereinstimmende Bedingung den Ausführungspfad bestimmt.
### Format für Bedingungsausdrücke
Bedingungen verwenden JavaScript-Syntax und können auf Eingabewerte aus vorherigen Blöcken verweisen.
**Benutzer-Onboarding-Ablauf** - Onboarding basierend auf Benutzertyp personalisieren
```
Function (Process) → Condition (account_type === 'enterprise') → Advanced or Simple
```
## Bewährte Praktiken
- **Bedingungen korrekt anordnen**: Platzieren Sie spezifischere Bedingungen vor allgemeinen, um sicherzustellen, dass spezifische Logik Vorrang vor Fallbacks hat
- **Verwenden Sie den Else-Zweig bei Bedarf**: Wenn keine Bedingungen übereinstimmen und der Else-Zweig nicht verbunden ist, endet der Workflow-Zweig ordnungsgemäß. Verbinden Sie den Else-Zweig, wenn Sie einen Fallback-Pfad für nicht übereinstimmende Fälle benötigen
- **Halten Sie Ausdrücke einfach**: Verwenden Sie klare, unkomplizierte boolesche Ausdrücke für bessere Lesbarkeit und einfachere Fehlersuche
- **Dokumentieren Sie Ihre Bedingungen**: Fügen Sie Beschreibungen hinzu, um den Zweck jeder Bedingung für bessere Teamzusammenarbeit und Wartung zu erklären
- **Testen Sie Grenzfälle**: Überprüfen Sie, ob Bedingungen Grenzwerte korrekt behandeln, indem Sie mit Werten an den Grenzen Ihrer Bedingungsbereiche testen
import { Callout } from 'fumadocs-ui/components/callout'
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
import { Image } from '@/components/ui/image'
Der Evaluator-Block nutzt KI, um die Inhaltsqualität anhand benutzerdefinierter Metriken zu bewerten. Perfekt für Qualitätskontrolle, A/B-Tests und um sicherzustellen, dass KI-Ausgaben bestimmte Standards erfüllen.
<div className="flex justify-center">
<Image
src="/static/blocks/evaluator.png"
alt="Evaluator-Block-Konfiguration"
width={500}
height={400}
className="my-6"
/>
</div>
## Konfigurationsoptionen
### Bewertungsmetriken
Definieren Sie benutzerdefinierte Metriken, anhand derer Inhalte bewertet werden. Jede Metrik umfasst:
- **Name**: Eine kurze Bezeichnung für die Metrik
- **Beschreibung**: Eine detaillierte Erklärung, was die Metrik misst
- **Bereich**: Der numerische Bereich für die Bewertung (z.B. 1-5, 0-10)
Beispielmetriken:
```
Accuracy (1-5): How factually accurate is the content?
Clarity (1-5): How clear and understandable is the content?
Relevance (1-5): How relevant is the content to the original query?
```
### Inhalt
Der zu bewertende Inhalt. Dies kann sein:
- Direkt in der Blockkonfiguration bereitgestellt
- Verbunden mit der Ausgabe eines anderen Blocks (typischerweise ein Agent-Block)
- Dynamisch während der Workflow-Ausführung generiert
### Modellauswahl
Wählen Sie ein KI-Modell für die Durchführung der Bewertung:
- **Verwenden Sie spezifische Metrikbeschreibungen**: Definieren Sie klar, was jede Metrik misst, um genauere Bewertungen zu erhalten
- **Wählen Sie geeignete Bereiche**: Wählen Sie Bewertungsbereiche, die ausreichend Granularität bieten, ohne zu komplex zu sein
- **Verbinden Sie mit Agent-Blöcken**: Verwenden Sie Evaluator-Blöcke, um die Ausgaben von Agent-Blöcken zu bewerten und Feedback-Schleifen zu erstellen
- **Verwenden Sie konsistente Metriken**: Für vergleichende Analysen sollten Sie konsistente Metriken über ähnliche Bewertungen hinweg beibehalten
- **Kombinieren Sie mehrere Metriken**: Verwenden Sie verschiedene Metriken, um eine umfassende Bewertung zu erhalten
Der Funktionsblock führt benutzerdefinierten JavaScript- oder TypeScript-Code in Ihren Workflows aus. Transformieren Sie Daten, führen Sie Berechnungen durch oder implementieren Sie benutzerdefinierte Logik.
<div className="flex justify-center">
<Image
src="/static/blocks/function.png"
alt="Funktionsblock mit Code-Editor"
width={500}
height={400}
className="my-6"
/>
</div>
## Ausgaben
- **`<function.result>`**: Der von Ihrer Funktion zurückgegebene Wert
- **`<function.stdout>`**: Console.log()-Ausgabe Ihres Codes
## Beispielanwendungsfälle
**Datenverarbeitungspipeline** - Transformation von API-Antworten in strukturierte Daten
```
API (Fetch) → Function (Process & Validate) → Function (Calculate Metrics) → Response
```
**Implementierung von Geschäftslogik** - Berechnung von Treuepunkten und Stufen
```
Agent (Get History) → Function (Calculate Score) → Function (Determine Tier) → Condition (Route)
```
**Datenvalidierung und -bereinigung** - Validierung und Bereinigung von Benutzereingaben
```
Input → Function (Validate & Sanitize) → API (Save to Database)
```
### Beispiel: Treuepunkte-Rechner
```javascript title="loyalty-calculator.js"
// Process customer data and calculate loyalty score
import { Callout } from 'fumadocs-ui/components/callout'
import { Image } from '@/components/ui/image'
import { Video } from '@/components/ui/video'
Der Guardrails-Block validiert und schützt Ihre KI-Workflows, indem er Inhalte anhand mehrerer Validierungstypen überprüft. Stellen Sie die Datenqualität sicher, verhindern Sie Halluzinationen, erkennen Sie personenbezogene Daten und erzwingen Sie Formatanforderungen, bevor Inhalte durch Ihren Workflow fließen.
<div className="flex justify-center">
<Image
src="/static/blocks/guardrails.png"
alt="Guardrails-Block"
width={500}
height={400}
className="my-6"
/>
</div>
## Validierungstypen
### JSON-Validierung
Überprüft, ob der Inhalt korrekt formatiertes JSON ist. Perfekt, um sicherzustellen, dass strukturierte LLM-Ausgaben sicher geparst werden können.
**Anwendungsfälle:**
- Validierung von JSON-Antworten aus Agent-Blöcken vor dem Parsen
- Sicherstellen, dass API-Payloads korrekt formatiert sind
- Überprüfung der Integrität strukturierter Daten
**Ausgabe:**
- `passed`: `true` bei gültigem JSON, sonst `false`
Prüft, ob der Inhalt einem bestimmten regulären Ausdrucksmuster entspricht.
**Anwendungsfälle:**
- Validierung von E-Mail-Adressen
- Überprüfung von Telefonnummernformaten
- Verifizierung von URLs oder benutzerdefinierten Kennungen
- Durchsetzung spezifischer Textmuster
**Konfiguration:**
- **Regex-Muster**: Der reguläre Ausdruck, gegen den geprüft wird (z.B. `^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$` für E-Mails)
**Ausgabe:**
- `passed`: `true` wenn der Inhalt dem Muster entspricht, sonst `false`
- `error`: Fehlermeldung bei fehlgeschlagener Validierung
### Halluzinationserkennung
Verwendet Retrieval-Augmented Generation (RAG) mit LLM-Bewertung, um zu erkennen, wann KI-generierte Inhalte im Widerspruch zu Ihrer Wissensdatenbank stehen oder nicht darin begründet sind.
**Funktionsweise:**
1. Abfrage Ihrer Wissensdatenbank nach relevantem Kontext
2. Übermittlung sowohl der KI-Ausgabe als auch des abgerufenen Kontexts an ein LLM
**Halluzinationen verhindern** - Validieren Sie Kundendienstantworten anhand der Wissensdatenbank
```
Agent (Response) → Guardrails (Check KB) → Condition (Score ≥ 3) → Send or Flag
```
**PII in Benutzereingaben blockieren** - Bereinigen Sie von Benutzern übermittelte Inhalte
```
Input → Guardrails (Detect PII) → Condition (No PII) → Process or Reject
```
## Bewährte Praktiken
- **Verkettung mit Bedingungsblöcken**: Verwenden Sie `<guardrails.passed>`, um die Workflow-Logik basierend auf Validierungsergebnissen zu verzweigen
- **JSON-Validierung vor dem Parsen verwenden**: Validieren Sie immer die JSON-Struktur, bevor Sie versuchen, LLM-Ausgaben zu parsen
- **Geeignete PII-Typen auswählen**: Wählen Sie nur die für Ihren Anwendungsfall relevanten PII-Entitätstypen für bessere Leistung
- **Angemessene Konfidenzgrenzwerte festlegen**: Passen Sie für die Halluzinationserkennung den Grenzwert an Ihre Genauigkeitsanforderungen an (höher = strenger)
- **Starke Modelle für die Halluzinationserkennung verwenden**: GPT-4o oder Claude 3.7 Sonnet bieten genauere Konfidenzwerte
- **PII für die Protokollierung maskieren**: Verwenden Sie den Modus "Mask", wenn Sie Inhalte protokollieren oder speichern müssen, die PII enthalten könnten
- **Regex-Muster testen**: Validieren Sie Ihre Regex-Muster gründlich, bevor Sie sie in der Produktion einsetzen
- **Validierungsfehler überwachen**: Verfolgen Sie `<guardrails.error>`Nachrichten, um häufige Validierungsprobleme zu identifizieren
<Callout type="info">
Die Validierung von Guardrails erfolgt synchron in Ihrem Workflow. Für die Erkennung von Halluzinationen sollten Sie schnellere Modelle (wie GPT-4o-mini) wählen, wenn die Latenz kritisch ist.
import { Callout } from 'fumadocs-ui/components/callout'
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
import { Image } from '@/components/ui/image'
import { Video } from '@/components/ui/video'
Der Human in the Loop Block pausiert die Workflow-Ausführung und wartet auf menschliches Eingreifen, bevor er fortfährt. Verwenden Sie ihn, um Genehmigungspunkte hinzuzufügen, Feedback zu sammeln oder zusätzliche Eingaben an kritischen Entscheidungspunkten einzuholen.
<div className="flex justify-center">
<Image
src="/static/blocks/hitl-1.png"
alt="Human in the Loop Block Konfiguration"
width={500}
height={400}
className="my-6"
/>
</div>
Wenn die Ausführung diesen Block erreicht, pausiert der Workflow auf unbestimmte Zeit, bis ein Mensch über das Genehmigungsportal, die API oder den Webhook eine Eingabe macht.
<div className="flex justify-center">
<Image
src="/static/blocks/hitl-2.png"
alt="Human in the Loop Genehmigungsportal"
width={700}
height={500}
className="my-6"
/>
</div>
## Konfigurationsoptionen
### Pausierte Ausgabe
Definiert, welche Daten dem Genehmigenden angezeigt werden. Dies ist der Kontext, der im Genehmigungsportal angezeigt wird, um eine fundierte Entscheidung zu ermöglichen.
Verwenden Sie den visuellen Builder oder den JSON-Editor, um die Daten zu strukturieren. Referenzieren Sie Workflow-Variablen mit der `<blockName.output>` Syntax.
```json
{
"customerName": "<agent1.content.name>",
"proposedAction": "<router1.selectedPath>",
"confidenceScore": "<evaluator1.score>",
"generatedEmail": "<agent2.content>"
}
```
### Benachrichtigung
Konfiguriert, wie Genehmigende benachrichtigt werden, wenn eine Genehmigung erforderlich ist. Unterstützte Kanäle sind:
Fügen Sie die Genehmigungs-URL (`<blockId.url>`) in Ihre Benachrichtigungsnachrichten ein, damit Genehmigende auf das Portal zugreifen können.
### Fortsetzungseingabe
Definiert die Felder, die Genehmigende bei der Antwort ausfüllen. Diese Daten werden nach der Fortsetzung des Workflows für nachfolgende Blöcke verfügbar.
```json
{
"approved": {
"type": "boolean",
"description": "Approve or reject this request"
},
"comments": {
"type": "string",
"description": "Optional feedback or explanation"
}
}
```
Greifen Sie in nachgelagerten Blöcken auf Wiederaufnahmedaten mit `<blockId.resumeInput.fieldName>` zu.
Jeder Block generiert eine eindeutige Portal-URL (`<blockId.url>`) mit einer visuellen Oberfläche, die alle pausierten Ausgabedaten und Formularfelder für die Fortsetzungseingabe anzeigt. Mobilgerätekompatibel und sicher.
Teilen Sie diese URL in Benachrichtigungen, damit Genehmiger die Anfragen prüfen und beantworten können.
</Tab>
<Tab>
### REST API
Workflows programmatisch fortsetzen:
```bash
POST /api/workflows/{workflowId}/executions/{executionId}/resume/{blockId}
{
"approved": true,
"comments": "Looks good to proceed"
}
```
Erstellen Sie benutzerdefinierte Genehmigungs-UIs oder integrieren Sie bestehende Systeme.
</Tab>
<Tab>
### Webhook
Fügen Sie ein Webhook-Tool im Benachrichtigungsbereich hinzu, um Genehmigungsanfragen an externe Systeme zu senden. Integration mit Ticketing-Systemen wie Jira oder ServiceNow.
</Tab>
</Tabs>
## Häufige Anwendungsfälle
**Inhaltsgenehmigung** - Überprüfung von KI-generierten Inhalten vor der Veröffentlichung
```
Agent → Human in the Loop → API (Publish)
```
**Mehrstufige Genehmigungen** - Verkettung mehrerer Genehmigungsschritte für wichtige Entscheidungen
```
Agent → Human in the Loop (Manager) → Human in the Loop (Director) → Execute
```
**Datenvalidierung** - Überprüfung extrahierter Daten vor der Verarbeitung
```
Agent (Extract) → Human in the Loop (Validate) → Function (Process)
```
**Qualitätskontrolle** - Überprüfung von KI-Ausgaben vor dem Versand an Kunden
```
Agent (Generate) → Human in the Loop (QA) → Gmail (Send)
```
## Block-Ausgaben
**`url`** - Eindeutige URL für das Genehmigungsportal
**`resumeInput.*`** - Alle in der Fortsetzungseingabe definierten Felder werden verfügbar, nachdem der Workflow fortgesetzt wird
Zugriff über `<blockId.resumeInput.fieldName>`.
## Beispiel
**Pausierte Ausgabe:**
```json
{
"title": "<agent1.content.title>",
"body": "<agent1.content.body>",
"qualityScore": "<evaluator1.score>"
}
```
**Fortsetzungseingabe:**
```json
{
"approved": { "type": "boolean" },
"feedback": { "type": "string" }
}
```
**Nachgelagerte Verwendung:**
```javascript
// Condition block
<approval1.resumeInput.approved> === true
```
Das Beispiel unten zeigt ein Genehmigungsportal, wie es von einem Genehmiger gesehen wird, nachdem der Workflow angehalten wurde. Genehmiger können die Daten überprüfen und Eingaben als Teil der Workflow-Wiederaufnahme bereitstellen. Auf das Genehmigungsportal kann direkt über die eindeutige URL, `<blockId.url>`, zugegriffen werden.
import { Card, Cards } from 'fumadocs-ui/components/card'
import { Step, Steps } from 'fumadocs-ui/components/steps'
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
import { Video } from '@/components/ui/video'
Blöcke sind die Bausteine, die du miteinander verbindest, um KI-Workflows zu erstellen. Betrachte sie als spezialisierte Module, die jeweils eine bestimmte Aufgabe übernehmen – vom Chatten mit KI-Modellen über API-Aufrufe bis hin zur Datenverarbeitung.
import { Callout } from 'fumadocs-ui/components/callout'
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
import { Image } from '@/components/ui/image'
Der Schleifenblock ist ein Container, der Blöcke wiederholt ausführt. Iteriere über Sammlungen, wiederhole Operationen eine festgelegte Anzahl von Malen oder fahre fort, solange eine Bedingung erfüllt ist.
<Callout type="info">
Schleifenblöcke sind Container-Knoten, die andere Blöcke in sich enthalten. Die enthaltenen Blöcke werden mehrfach ausgeführt, basierend auf deiner Konfiguration.
**For-Schleife (Iterationen)** - Eine numerische Schleife, die eine festgelegte Anzahl von Malen ausgeführt wird:
<div className="flex justify-center">
<Image
src="/static/blocks/loop-1.png"
alt="For-Schleife mit Iterationen"
width={500}
height={400}
className="my-6"
/>
</div>
Verwende diese, wenn du eine Operation eine bestimmte Anzahl von Malen wiederholen musst.
```
Example: Run 5 times
- Iteration 1
- Iteration 2
- Iteration 3
- Iteration 4
- Iteration 5
```
</Tab>
<Tab>
**ForEach-Schleife (Sammlung)** - Eine sammlungsbasierte Schleife, die über jedes Element in einem Array oder Objekt iteriert:
<div className="flex justify-center">
<Image
src="/static/blocks/loop-2.png"
alt="ForEach-Schleife mit Sammlung"
width={500}
height={400}
className="my-6"
/>
</div>
Verwende diese, wenn du eine Sammlung von Elementen verarbeiten musst.
```
Example: Process ["apple", "banana", "orange"]
- Iteration 1: Process "apple"
- Iteration 2: Process "banana"
- Iteration 3: Process "orange"
```
</Tab>
<Tab>
**While-Schleife (Bedingungsbasiert)** - Wird ausgeführt, solange eine Bedingung als wahr ausgewertet wird:
<div className="flex justify-center">
<Image
src="/static/blocks/loop-3.png"
alt="While-Schleife mit Bedingung"
width={500}
height={400}
className="my-6"
/>
</div>
Verwende diese, wenn du eine Schleife benötigst, die läuft, bis eine bestimmte Bedingung erfüllt ist. Die Bedingung wird **vor** jeder Iteration überprüft.
```
Example: While {"<variable.i>"} < 10
- Check condition → Execute if true
- Inside loop: Increment {"<variable.i>"}
- Inside loop: Variables assigns i = {"<variable.i>"} + 1
- Check condition → Execute if true
- Check condition → Exit if false
```
</Tab>
<Tab>
**Do-While-Schleife (Bedingungsbasiert)** - Wird mindestens einmal ausgeführt und dann fortgesetzt, solange eine Bedingung wahr ist:
<div className="flex justify-center">
<Image
src="/static/blocks/loop-4.png"
alt="Do-While-Schleife mit Bedingung"
width={500}
height={400}
className="my-6"
/>
</div>
Verwende diese, wenn du eine Operation mindestens einmal ausführen musst und dann die Schleife fortsetzen willst, bis eine Bedingung erfüllt ist. Die Bedingung wird **nach** jeder Iteration überprüft.
```
Example: Do-while {"<variable.i>"} < 10
- Execute blocks
- Inside loop: Increment {"<variable.i>"}
- Inside loop: Variables assigns i = {"<variable.i>"} + 1
- Check condition → Continue if true
- Check condition → Exit if false
```
</Tab>
</Tabs>
## Wie man Schleifen verwendet
### Eine Schleife erstellen
1. Ziehe einen Schleifenblock aus der Werkzeugleiste auf deine Leinwand
2. Konfiguriere den Schleifentyp und die Parameter
3. Ziehe andere Blöcke in den Schleifencontainer
4. Verbinde die Blöcke nach Bedarf
### Auf Ergebnisse zugreifen
Nach Abschluss einer Schleife kannst du auf aggregierte Ergebnisse zugreifen:
- **loop.results**: Array mit Ergebnissen aller Schleifendurchläufe
## Beispielanwendungsfälle
**Verarbeitung von API-Ergebnissen** - ForEach-Schleife verarbeitet Kundendatensätze aus einer API
```javascript
// Beispiel: ForEach-Schleife für API-Ergebnisse
const customers = await api.getCustomers();
loop.forEach(customers, (customer) => {
// Verarbeite jeden Kunden
if (customer.status === 'active') {
sendEmail(customer.email, 'Sonderangebot');
}
});
```
**Iterative Inhaltsgenerierung** - For-Schleife generiert mehrere Inhaltsvariationen
```javascript
// Beispiel: For-Schleife für Inhaltsgenerierung
const variations = [];
loop.for(5, (i) => {
// Generiere 5 verschiedene Variationen
const content = ai.generateContent({
prompt: `Variation ${i+1} für Produktbeschreibung`,
temperature: 0.7 + (i * 0.1)
});
variations.push(content);
});
```
**Zähler mit While-Schleife** - While-Schleife verarbeitet Elemente mit Zähler
```javascript
// Beispiel: While-Schleife mit Zähler
let counter = 0;
let processedItems = 0;
loop.while(() => counter < items.length, () => {
if (items[counter].isValid) {
processItem(items[counter]);
processedItems++;
}
counter++;
});
console.log(`${processedItems} gültige Elemente verarbeitet`);
```
## Erweiterte Funktionen
### Einschränkungen
<Callout type="warning">
Container-Blöcke (Schleifen und Parallele) können nicht ineinander verschachtelt werden. Das bedeutet:
- Du kannst keinen Schleifenblock in einen anderen Schleifenblock platzieren
- Du kannst keinen Parallel-Block in einen Schleifenblock platzieren
- Du kannst keinen Container-Block in einen anderen Container-Block platzieren
Wenn du mehrdimensionale Iterationen benötigst, erwäge eine Umstrukturierung deines Workflows, um sequentielle Schleifen zu verwenden oder Daten in Stufen zu verarbeiten.
</Callout>
<Callout type="info">
Schleifen werden sequentiell ausgeführt, nicht parallel. Wenn du eine gleichzeitige Ausführung benötigst, verwende stattdessen den Parallel-Block.
import { Callout } from 'fumadocs-ui/components/callout'
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
import { Image } from '@/components/ui/image'
Der Parallel-Block ist ein Container, der mehrere Instanzen gleichzeitig ausführt, um Workflows schneller zu verarbeiten. Verarbeiten Sie Elemente simultan statt sequentiell.
<Callout type="info">
Parallel-Blöcke sind Container-Knoten, die ihre Inhalte mehrfach gleichzeitig ausführen, im Gegensatz zu Schleifen, die sequentiell ausgeführt werden.
</Callout>
## Konfigurationsoptionen
### Parallel-Typ
Wählen Sie zwischen zwei Arten der parallelen Ausführung:
import { Callout } from 'fumadocs-ui/components/callout'
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
import { Image } from '@/components/ui/image'
Der Response-Block formatiert und sendet strukturierte HTTP-Antworten zurück an API-Aufrufer. Verwenden Sie ihn, um Workflow-Ergebnisse mit korrekten Statuscodes und Headern zurückzugeben.
<div className="flex justify-center">
<Image
src="/static/blocks/response.png"
alt="Konfiguration des Antwort-Blocks"
width={500}
height={400}
className="my-6"
/>
</div>
<Callout type="info">
Response-Blöcke sind terminale Blöcke - sie beenden die Workflow-Ausführung und können nicht mit anderen Blöcken verbunden werden.
</Callout>
## Konfigurationsoptionen
### Antwortdaten
Die Antwortdaten sind der Hauptinhalt, der an den API-Aufrufer zurückgesendet wird. Diese sollten als JSON formatiert sein und können Folgendes enthalten:
- Statische Werte
- Dynamische Verweise auf Workflow-Variablen mit der `<variable.name>` Syntax
- Verschachtelte Objekte und Arrays
- Jede gültige JSON-Struktur
### Statuscode
Legen Sie den HTTP-Statuscode für die Antwort fest (standardmäßig 200):
Antwortblöcke sind endgültig - sie beenden die Workflow-Ausführung und senden die HTTP-Antwort an den API-Aufrufer. Es stehen keine Ausgaben für nachgelagerte Blöcke zur Verfügung.
## Variablenreferenzen
Verwenden Sie die `<variable.name>` Syntax, um Workflow-Variablen dynamisch in Ihre Antwort einzufügen:
```json
{
"user": {
"id": "<variable.userId>",
"name": "<variable.userName>",
"email": "<variable.userEmail>"
},
"query": "<variable.searchQuery>",
"results": "<variable.searchResults>",
"totalFound": "<variable.resultCount>",
"processingTime": "<variable.executionTime>ms"
}
```
<Callout type="warning">
Variablennamen sind Groß- und Kleinschreibung sensitiv und müssen exakt mit den in Ihrem Workflow verfügbaren Variablen übereinstimmen.
</Callout>
## Best Practices
- **Verwenden Sie aussagekräftige Statuscodes**: Wählen Sie passende HTTP-Statuscodes, die das Ergebnis des Workflows genau widerspiegeln
- **Strukturieren Sie Ihre Antworten einheitlich**: Behalten Sie eine konsistente JSON-Struktur über alle Ihre API-Endpunkte bei, um eine bessere Entwicklererfahrung zu gewährleisten
- **Fügen Sie relevante Metadaten hinzu**: Fügen Sie Zeitstempel und Versionsinformationen hinzu, um bei der Fehlerbehebung und Überwachung zu helfen
- **Behandeln Sie Fehler elegant**: Verwenden Sie bedingte Logik in Ihrem Workflow, um angemessene Fehlerantworten mit aussagekräftigen Meldungen zu setzen
- **Validieren Sie Variablenreferenzen**: Stellen Sie sicher, dass alle referenzierten Variablen existieren und die erwarteten Datentypen enthalten, bevor der Antwortblock ausgeführt wird
import { Callout } from 'fumadocs-ui/components/callout'
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
import { Image } from '@/components/ui/image'
Der Router-Block verwendet KI, um Workflows basierend auf Inhaltsanalysen intelligent zu leiten. Im Gegensatz zu Bedingungsblöcken, die einfache Regeln verwenden, verstehen Router Kontext und Absicht.
<div className="flex justify-center">
<Image
src="/static/blocks/router.png"
alt="Router-Block mit mehreren Pfaden"
width={500}
height={400}
className="my-6"
/>
</div>
## Router vs. Bedingung
**Verwende Router, wenn:**
- KI-gestützte Inhaltsanalyse benötigt wird
- Mit unstrukturierten oder variierenden Inhalten gearbeitet wird
- Absichtsbasierte Weiterleitung erforderlich ist (z.B. "Support-Tickets an Abteilungen weiterleiten")
- **Klare Zielbeschreibungen bereitstellen**: Helfen Sie dem Router zu verstehen, wann jedes Ziel ausgewählt werden soll, mit spezifischen, detaillierten Beschreibungen
- **Spezifische Routing-Kriterien verwenden**: Definieren Sie klare Bedingungen und Beispiele für jeden Pfad, um die Genauigkeit zu verbessern
- **Fallback-Pfade implementieren**: Verbinden Sie ein Standardziel für Fälle, in denen kein spezifischer Pfad geeignet ist
- **Mit verschiedenen Eingaben testen**: Stellen Sie sicher, dass der Router verschiedene Eingabetypen, Grenzfälle und unerwartete Inhalte verarbeiten kann
- **Routing-Leistung überwachen**: Überprüfen Sie Routing-Entscheidungen regelmäßig und verfeinern Sie Kriterien basierend auf tatsächlichen Nutzungsmustern
- **Geeignete Modelle auswählen**: Verwenden Sie Modelle mit starken Argumentationsfähigkeiten für komplexe Routing-Entscheidungen
import { Callout } from 'fumadocs-ui/components/callout'
import { Step, Steps } from 'fumadocs-ui/components/steps'
import { Image } from '@/components/ui/image'
Der Variablen-Block aktualisiert Workflow-Variablen während der Ausführung. Variablen müssen zuerst im Variablen-Bereich deines Workflows initialisiert werden, dann kannst du diesen Block verwenden, um ihre Werte während der Ausführung deines Workflows zu aktualisieren.
<div className="flex justify-center">
<Image
src="/static/blocks/variables.png"
alt="Variablen-Block"
width={500}
height={400}
className="my-6"
/>
</div>
<Callout>
Greife überall in deinem Workflow auf Variablen zu, indem du die `<variable.variableName>` Syntax verwendest.
</Callout>
## Wie man Variablen verwendet
### 1. Initialisierung in Workflow-Variablen
Erstellen Sie zunächst Ihre Variablen im Variablenbereich des Workflows (zugänglich über die Workflow-Einstellungen):
```
customerEmail = ""
retryCount = 0
currentStatus = "pending"
```
### 2. Aktualisierung mit dem Variablen-Block
Verwenden Sie den Variablen-Block, um diese Werte während der Ausführung zu aktualisieren:
```
customerEmail = <api.email>
retryCount = <variable.retryCount> + 1
currentStatus = "processing"
```
### 3. Überall zugreifen
Referenzieren Sie Variablen in jedem Block:
```
Agent prompt: "Send email to <variable.customerEmail>"
Condition: <variable.retryCount> < 5
API body: {"status": "<variable.currentStatus>"}
```
## Beispielanwendungsfälle
**Schleifenzähler und Status** - Fortschritt durch Iterationen verfolgen
import { Callout } from 'fumadocs-ui/components/callout'
import { Step, Steps } from 'fumadocs-ui/components/steps'
import { Image } from '@/components/ui/image'
Der Warten-Block pausiert deinen Workflow für eine bestimmte Zeit, bevor er mit dem nächsten Block fortfährt. Verwende ihn, um Verzögerungen zwischen Aktionen einzufügen, API-Ratenbegrenzungen einzuhalten oder Operationen zeitlich zu verteilen.
<div className="flex justify-center">
<Image
src="/static/blocks/wait.png"
alt="Warte-Block"
width={500}
height={400}
className="my-6"
/>
</div>
## Konfiguration
### Wartezeit
Geben Sie die Dauer für die Ausführungspause ein:
- **Eingabe**: Positive Zahl
- **Maximum**: 600 Sekunden (10 Minuten) oder 10 Minuten
### Einheit
Wählen Sie die Zeiteinheit:
- **Sekunden**: Für kurze, präzise Verzögerungen
- **Minuten**: Für längere Pausen
<Callout type="info">
Warteblöcke können durch Stoppen des Workflows abgebrochen werden. Die maximale Wartezeit beträgt 10 Minuten.
</Callout>
## Ausgaben
- **`<wait.waitDuration>`**: Die Wartezeit in Millisekunden
- **`<wait.status>`**: Status der Wartezeit ('waiting', 'completed' oder 'cancelled')
## Beispielanwendungsfälle
**API-Ratenbegrenzung** - Bleiben Sie zwischen Anfragen innerhalb der API-Ratenlimits
```
API (Request 1) → Wait (2s) → API (Request 2)
```
**Zeitgesteuerte Benachrichtigungen** - Senden Sie Folgenachrichten nach einer Verzögerung
```
Function (Send Email) → Wait (5min) → Function (Follow-up)
```
**Verarbeitungsverzögerungen** - Warten Sie, bis das externe System die Verarbeitung abgeschlossen hat
```
API (Trigger Job) → Wait (30s) → API (Check Status)
```
## Bewährte Praktiken
- **Halten Sie Wartezeiten angemessen**: Verwenden Sie Wait für Verzögerungen bis zu 10 Minuten. Für längere Verzögerungen sollten Sie geplante Workflows in Betracht ziehen
- **Überwachen Sie die Ausführungszeit**: Denken Sie daran, dass Wartezeiten die Gesamtdauer des Workflows verlängern
Füge einen Workflow-Block hinzu, wenn du einen untergeordneten Workflow als Teil eines größeren Ablaufs aufrufen möchtest. Der Block führt die neueste bereitgestellte Version dieses Workflows aus, wartet auf dessen Abschluss und setzt dann mit dem übergeordneten Workflow fort.
## Konfiguration
1. **Wähle einen Workflow** aus dem Dropdown-Menü (Selbstreferenzen sind blockiert, um Schleifen zu verhindern).
2. **Eingaben zuordnen**: Wenn der untergeordnete Workflow einen Eingabeformular-Trigger hat, siehst du jedes Feld und kannst übergeordnete Variablen verbinden. Die zugeordneten Werte sind das, was der untergeordnete Workflow erhält.
<div className='flex justify-center my-6'>
<Image
src='/static/blocks/workflow-2.png'
alt='Workflow-Block mit Beispiel für Eingabezuordnung'
3. **Ausgaben**: Nachdem der untergeordnete Workflow abgeschlossen ist, stellt der Block folgendes bereit:
- `result` – die endgültige Antwort des untergeordneten Workflows
- `success` – ob er ohne Fehler ausgeführt wurde
- `error` – Nachricht, wenn die Ausführung fehlschlägt
## Bereitstellungsstatus-Badge
Der Workflow-Block zeigt ein Bereitstellungsstatus-Badge an, das dir hilft zu verfolgen, ob der untergeordnete Workflow ausführungsbereit ist:
- **Bereitgestellt** – Der untergeordnete Workflow wurde bereitgestellt und ist einsatzbereit. Der Block führt die aktuell bereitgestellte Version aus.
- **Nicht bereitgestellt** – Der untergeordnete Workflow wurde noch nie bereitgestellt. Du musst ihn bereitstellen, bevor der Workflow-Block ihn ausführen kann.
- **Erneut bereitstellen** – Seit der letzten Bereitstellung wurden Änderungen im untergeordneten Workflow erkannt. Klicke auf das Badge, um den untergeordneten Workflow mit den neuesten Änderungen erneut bereitzustellen.
<Callout type="warn">
Der Workflow-Block führt immer die zuletzt bereitgestellte Version des untergeordneten Workflows aus, nicht die Editor-Version. Stelle sicher, dass du nach Änderungen eine erneute Bereitstellung durchführst, damit der Block die neueste Logik verwendet.
</Callout>
## Hinweise zur Ausführung
- Untergeordnete Workflows laufen im gleichen Workspace-Kontext, sodass Umgebungsvariablen und Tools übernommen werden.
- Der Block verwendet Bereitstellungsversionierung: Jede API-, Zeitplan-, Webhook-, manuelle oder Chat-Ausführung ruft den bereitgestellten Snapshot auf. Stelle den untergeordneten Workflow nach Änderungen erneut bereit.
- Wenn der untergeordnete Workflow fehlschlägt, löst der Block einen Fehler aus, es sei denn, du behandelst ihn nachgelagert.
<Callout>
Halte untergeordnete Workflows fokussiert. Kleine, wiederverwendbare Abläufe machen es einfacher, sie zu kombinieren, ohne tiefe Verschachtelungen zu erzeugen.
import { Callout } from 'fumadocs-ui/components/callout'
import { Step, Steps } from 'fumadocs-ui/components/steps'
import { Video } from '@/components/ui/video'
## Wie Verbindungen funktionieren
Verbindungen sind die Pfade, die den Datenfluss zwischen Blöcken in Ihrem Workflow ermöglichen. In Sim definieren Verbindungen, wie Informationen von einem Block zum anderen übertragen werden und ermöglichen so den Datenfluss durch Ihren gesamten Workflow.
<Callout type="info">
Jede Verbindung stellt eine gerichtete Beziehung dar, bei der Daten vom Ausgang eines Quellblocks
zum Eingang eines Zielblocks fließen.
</Callout>
### Verbindungen erstellen
<Steps>
<Step>
<strong>Quellblock auswählen</strong>: Klicken Sie auf den Ausgangsport des Blocks, von dem aus Sie verbinden möchten
</Step>
<Step>
<strong>Verbindung ziehen</strong>: Ziehen Sie zum Eingangsport des Zielblocks
</Step>
<Step>
<strong>Verbindung bestätigen</strong>: Loslassen, um die Verbindung zu erstellen
Der Datenfluss durch Verbindungen folgt diesen Prinzipien:
1. **Gerichteter Fluss**: Daten fließen immer von Ausgängen zu Eingängen
2. **Ausführungsreihenfolge**: Blöcke werden basierend auf ihren Verbindungen der Reihe nach ausgeführt
3. **Datentransformation**: Daten können beim Übergang zwischen Blöcken transformiert werden
4. **Bedingte Pfade**: Einige Blöcke (wie Router und Bedingung) können den Fluss auf verschiedene Pfade leiten
<Callout type="warning">
Das Löschen einer Verbindung stoppt sofort den Datenfluss zwischen den Blöcken. Stellen Sie sicher, dass dies beabsichtigt ist, bevor Sie Verbindungen entfernen.
import { Callout } from 'fumadocs-ui/components/callout'
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
Wenn Sie Blöcke verbinden, ist das Verständnis der Datenstruktur verschiedener Block-Ausgaben wichtig, da die Ausgabedatenstruktur des Quellblocks bestimmt, welche Werte im Zielblock verfügbar sind. Jeder Blocktyp erzeugt eine spezifische Ausgabestruktur, auf die Sie in nachgelagerten Blöcken verweisen können.
<Callout type="info">
Das Verständnis dieser Datenstrukturen ist wesentlich für die effektive Nutzung von Verbindungs-Tags und
den Zugriff auf die richtigen Daten in Ihren Workflows.
</Callout>
## Block-Ausgabestrukturen
Verschiedene Blocktypen erzeugen unterschiedliche Ausgabestrukturen. Hier ist, was Sie von jedem Blocktyp erwarten können:
- **model**: Das für das Routing verwendete KI-Modell
- **tokens**: Statistiken zur Token-Nutzung
- **selectedPath**: Informationen über den ausgewählten Pfad
- **blockId**: ID des ausgewählten Zielblocks
- **blockType**: Typ des ausgewählten Blocks
- **blockTitle**: Titel des ausgewählten Blocks
</Tab>
</Tabs>
## Benutzerdefinierte Ausgabestrukturen
Einige Blöcke können basierend auf ihrer Konfiguration benutzerdefinierte Ausgabestrukturen erzeugen:
1. **Agent-Blöcke mit Antwortformat**: Bei Verwendung eines Antwortformats in einem Agent-Block entspricht die Ausgabestruktur dem definierten Schema anstelle der Standardstruktur.
2. **Function-Blöcke**: Das Feld `result` kann jede Datenstruktur enthalten, die von Ihrem Funktionscode zurückgegeben wird.
3. **API-Blöcke**: Das Feld `data` enthält die Rückgabe der API, die jede gültige JSON-Struktur sein kann.
<Callout type="warning">
Überprüfen Sie während der Entwicklung immer die tatsächliche Ausgabestruktur Ihrer Blöcke, um sicherzustellen, dass Sie in Ihren Verbindungen auf die richtigen Felder verweisen.
</Callout>
## Verschachtelte Datenstrukturen
Viele Block-Ausgaben enthalten verschachtelte Datenstrukturen. Du kannst auf diese mit Punktnotation in Verbindungs-Tags zugreifen:
```
<blockName.path.to.nested.data>
```
Zum Beispiel:
- `<agent1.tokens.total>` - Greife auf die Gesamtzahl der Tokens aus einem Agent-Block zu
- `<api1.data.results[0].id>` - Greife auf die ID des ersten Ergebnisses einer API-Antwort zu
- `<function1.result.calculations.total>` - Greife auf ein verschachteltes Feld im Ergebnis eines Funktionsblocks zu
import { Callout } from 'fumadocs-ui/components/callout'
import { Card, Cards } from 'fumadocs-ui/components/card'
import { ConnectIcon } from '@/components/icons'
import { Video } from '@/components/ui/video'
Verbindungen sind die Pfade, die den Datenfluss zwischen Blöcken in deinem Workflow ermöglichen. Sie definieren, wie Informationen von einem Block zum anderen weitergegeben werden und ermöglichen dir, komplexe, mehrstufige Prozesse zu erstellen.
<Callout type="info">
Richtig konfigurierte Verbindungen sind entscheidend für die Erstellung effektiver Workflows. Sie bestimmen, wie
Daten durch dein System fließen und wie Blöcke miteinander interagieren.
import { Callout } from 'fumadocs-ui/components/callout'
import { Video } from '@/components/ui/video'
Verbindungs-Tags sind visuelle Darstellungen der verfügbaren Daten aus verbundenen Blöcken und bieten eine einfache Möglichkeit, auf Daten zwischen Blöcken und Ausgaben aus vorherigen Blöcken in Ihrem Workflow zu verweisen.
Verbindungs-Tags sind interaktive Elemente, die erscheinen, wenn Blöcke verbunden werden. Sie repräsentieren die Daten, die von einem Block zum anderen fließen können und ermöglichen es Ihnen:
- Verfügbare Daten aus Quellblöcken zu visualisieren
- Auf bestimmte Datenfelder in Zielblöcken zu verweisen
- Dynamische Datenflüsse zwischen Blöcken zu erstellen
<Callout type="info">
Verbindungs-Tags machen es einfach zu sehen, welche Daten aus vorherigen Blöcken verfügbar sind und diese in Ihrem
aktuellen Block zu verwenden, ohne sich komplexe Datenstrukturen merken zu müssen.
</Callout>
## Verwendung von Verbindungs-Tags
Es gibt zwei Hauptmethoden, um Verbindungs-Tags in Ihren Workflows zu verwenden:
import { Callout } from 'fumadocs-ui/components/callout'
import { Card, Cards } from 'fumadocs-ui/components/card'
import { Image } from '@/components/ui/image'
import { MessageCircle, Package, Zap, Infinity as InfinityIcon, Brain, BrainCircuit } from 'lucide-react'
Copilot ist dein Assistent im Editor, der dir hilft, Workflows mit Sim Copilot zu erstellen und zu bearbeiten sowie diese zu verstehen und zu verbessern. Er kann:
- **Erklären**: Beantwortet Fragen zu Sim und deinem aktuellen Workflow
- **Anleiten**: Schlägt Bearbeitungen und Best Practices vor
- **Bearbeiten**: Nimmt Änderungen an Blöcken, Verbindungen und Einstellungen vor, wenn du zustimmst
<Callout type="info">
Copilot ist ein von Sim verwalteter Dienst. Für selbst gehostete Installationen generiere einen Copilot API-Schlüssel in der gehosteten App (sim.ai → Einstellungen → Copilot)
1. Gehe zu [sim.ai](https://sim.ai) → Einstellungen → Copilot und generiere einen Copilot API-Schlüssel
2. Setze `COPILOT_API_KEY` in deiner selbst gehosteten Umgebung auf diesen Wert
</Callout>
## Kontextmenü (@)
Verwende das `@` Symbol, um auf verschiedene Ressourcen zu verweisen und Copilot mehr Kontext über deinen Arbeitsbereich zu geben:
<Image
src="/static/copilot/copilot-menu.png"
alt="Copilot-Kontextmenü mit verfügbaren Referenzoptionen"
width={600}
height={400}
/>
Das `@` Menü bietet Zugriff auf:
- **Chats**: Verweise auf vorherige Copilot-Gespräche
- **Alle Workflows**: Verweise auf beliebige Workflows in deinem Arbeitsbereich
- **Workflow-Blöcke**: Verweise auf bestimmte Blöcke aus Workflows
- **Blöcke**: Verweise auf Blocktypen und Vorlagen
- **Wissen**: Verweise auf deine hochgeladenen Dokumente und Wissensdatenbank
- **Dokumentation**: Verweise auf Sim-Dokumentation
- **Vorlagen**: Verweise auf Workflow-Vorlagen
- **Logs**: Verweise auf Ausführungsprotokolle und Ergebnisse
Diese kontextbezogenen Informationen helfen Copilot, genauere und relevantere Unterstützung für deinen spezifischen Anwendungsfall zu bieten.
Erstellen-und-Bearbeiten-Modus. Copilot schlägt spezifische Änderungen vor (Blöcke hinzufügen, Variablen verbinden, Einstellungen anpassen) und wendet sie an, wenn du zustimmst.
</div>
</Card>
</Cards>
<div className="flex justify-center">
<Image
src="/static/copilot/copilot-mode.png"
alt="Copilot-Modusauswahl-Oberfläche"
width={600}
height={400}
className="my-6"
/>
</div>
## Tiefenebenen
<Cards>
<Card
title={
<span className="inline-flex items-center gap-2">
<Zap className="h-4 w-4 text-muted-foreground" />
Schnell
</span>
}
>
<div className="m-0 text-sm">Am schnellsten und günstigsten. Ideal für kleine Änderungen, einfache Arbeitsabläufe und geringfügige Anpassungen.</div>
<div className="m-0 text-sm">Maximale Denkleistung für tiefgreifende Planung, Fehlerbehebung und komplexe architektonische Änderungen.</div>
</Card>
</Cards>
### Modusauswahl-Oberfläche
Du kannst einfach zwischen verschiedenen Denkmodi über die Modusauswahl in der Copilot-Oberfläche wechseln:
<Image
src="/static/copilot/copilot-models.png"
alt="Copilot-Modusauswahl zeigt den erweiterten Modus mit MAX-Umschalter"
width={600}
height={300}
/>
Die Oberfläche ermöglicht dir:
- **Denkebene auswählen**: Wähle zwischen Schnell, Auto, Erweitert oder Behemoth
- **MAX-Modus aktivieren**: Umschalten für maximale Denkfähigkeiten, wenn du die gründlichste Analyse benötigst
- **Modusbeschreibungen anzeigen**: Verstehe, wofür jeder Modus optimiert ist
Wähle deinen Modus basierend auf der Komplexität deiner Aufgabe - verwende Schnell für einfache Fragen und Behemoth für komplexe architektonische Änderungen.
## Abrechnung und Kostenberechnung
### Wie Kosten berechnet werden
Die Copilot-Nutzung wird pro Token vom zugrundeliegenden LLM abgerechnet:
- **Eingabe-Tokens**: werden zum Basispreis des Anbieters berechnet (**zum Selbstkostenpreis**)
- **Ausgabe-Tokens**: werden mit dem **1,5-fachen** des Basis-Ausgabepreises des Anbieters berechnet
Die angezeigten Preise spiegeln die Tarife vom 4. September 2025 wider. Überprüfen Sie die Anbieter-Dokumentation für aktuelle Preise.
</Callout>
<Callout type="info">
Modellpreise werden pro Million Tokens angegeben. Die Berechnung teilt durch 1.000.000, um die tatsächlichen Kosten zu ermitteln. Siehe <a href="/execution/costs">die Seite zur Kostenberechnung</a> für Hintergründe und Beispiele.
import { Callout } from 'fumadocs-ui/components/callout'
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
import { Video } from '@/components/ui/video'
Sim bietet eine umfassende externe API zum Abfragen von Workflow-Ausführungsprotokollen und zum Einrichten von Webhooks für Echtzeit-Benachrichtigungen, wenn Workflows abgeschlossen werden.
## Authentifizierung
Alle API-Anfragen erfordern einen API-Schlüssel, der im Header `x-api-key` übergeben wird:
Sie können API-Schlüssel in Ihren Benutzereinstellungen im Sim-Dashboard generieren.
## Logs-API
Alle API-Antworten enthalten Informationen über Ihre Workflow-Ausführungslimits und -nutzung:
```json
"limits": {
"workflowExecutionRateLimit": {
"sync": {
"requestsPerMinute": 60, // Sustained rate limit per minute
"maxBurst": 120, // Maximum burst capacity
"remaining": 118, // Current tokens available (up to maxBurst)
"resetAt": "..." // When tokens next refill
},
"async": {
"requestsPerMinute": 200, // Sustained rate limit per minute
"maxBurst": 400, // Maximum burst capacity
"remaining": 398, // Current tokens available
"resetAt": "..." // When tokens next refill
}
},
"usage": {
"currentPeriodCost": 1.234, // Current billing period usage in USD
"limit": 10, // Usage limit in USD
"plan": "pro", // Current subscription plan
"isExceeded": false // Whether limit is exceeded
}
}
```
**Hinweis:** Ratenbegrenzungen verwenden einen Token-Bucket-Algorithmus. `remaining` kann `requestsPerMinute` bis zu `maxBurst` überschreiten, wenn du dein volles Kontingent in letzter Zeit nicht genutzt hast, was Burst-Traffic ermöglicht. Die Ratenbegrenzungen im Antworttext gelten für Workflow-Ausführungen. Die Ratenbegrenzungen für den Aufruf dieses API-Endpunkts befinden sich in den Antwort-Headern (`X-RateLimit-*`).
### Logs abfragen
Fragen Sie Workflow-Ausführungsprotokolle mit umfangreichen Filteroptionen ab.
Rufen Sie detaillierte Informationen zu einem bestimmten Logeintrag ab.
<Tabs items={['Request', 'Response']}>
<Tab value="Request">
```http
GET /api/v1/logs/{id}
```
</Tab>
<Tab value="Response">
```json
{
"data": {
"id": "log_abc123",
"workflowId": "wf_xyz789",
"executionId": "exec_def456",
"level": "info",
"trigger": "api",
"startedAt": "2025-01-01T12:34:56.789Z",
"endedAt": "2025-01-01T12:34:57.123Z",
"totalDurationMs": 334,
"workflow": {
"id": "wf_xyz789",
"name": "My Workflow",
"description": "Process customer data"
},
"executionData": {
"traceSpans": [...],
"finalOutput": {...}
},
"cost": {
"total": 0.00234,
"tokens": {
"prompt": 123,
"completion": 456,
"total": 579
},
"models": {
"gpt-4o": {
"input": 0.001,
"output": 0.00134,
"total": 0.00234,
"tokens": {
"prompt": 123,
"completion": 456,
"total": 579
}
}
}
},
"limits": {
"workflowExecutionRateLimit": {
"sync": {
"requestsPerMinute": 60,
"maxBurst": 120,
"remaining": 118,
"resetAt": "2025-01-01T12:35:56.789Z"
},
"async": {
"requestsPerMinute": 200,
"maxBurst": 400,
"remaining": 398,
"resetAt": "2025-01-01T12:35:56.789Z"
}
},
"usage": {
"currentPeriodCost": 1.234,
"limit": 10,
"plan": "pro",
"isExceeded": false
}
}
}
}
```
</Tab>
</Tabs>
### Ausführungsdetails abrufen
Rufen Sie Ausführungsdetails einschließlich des Workflow-Zustandsschnappschusses ab.
<Tabs items={['Request', 'Response']}>
<Tab value="Request">
```http
GET /api/v1/logs/executions/{executionId}
```
</Tab>
<Tab value="Response">
```json
{
"executionId": "exec_def456",
"workflowId": "wf_xyz789",
"workflowState": {
"blocks": {...},
"edges": [...],
"loops": {...},
"parallels": {...}
},
"executionMetadata": {
"trigger": "api",
"startedAt": "2025-01-01T12:34:56.789Z",
"endedAt": "2025-01-01T12:34:57.123Z",
"totalDurationMs": 334,
"cost": {...}
}
}
```
</Tab>
</Tabs>
## Benachrichtigungen
Erhalten Sie Echtzeit-Benachrichtigungen, wenn Workflow-Ausführungen abgeschlossen sind, per Webhook, E-Mail oder Slack. Benachrichtigungen werden auf Workspace-Ebene von der Protokollseite aus konfiguriert.
### Konfiguration
Konfigurieren Sie Benachrichtigungen von der Protokollseite aus, indem Sie auf die Menütaste klicken und "Benachrichtigungen konfigurieren" auswählen.
**Benachrichtigungskanäle:**
- **Webhook**: Senden Sie HTTP POST-Anfragen an Ihren Endpunkt
- **E-Mail**: Erhalten Sie E-Mail-Benachrichtigungen mit Ausführungsdetails
- **Slack**: Posten Sie Nachrichten in einen Slack-Kanal
**Workflow-Auswahl:**
- Wählen Sie bestimmte Workflows zur Überwachung aus
- Oder wählen Sie "Alle Workflows", um aktuelle und zukünftige Workflows einzubeziehen
**Filteroptionen:**
- `levelFilter`: Zu empfangende Protokollebenen (`info`, `error`)
- `triggerFilter`: Zu empfangende Auslösertypen (`api`, `webhook`, `schedule`, `manual`, `chat`)
**Optionale Daten:**
- `includeFinalOutput`: Schließt die endgültige Ausgabe des Workflows ein
- `includeTraceSpans`: Schließt detaillierte Ausführungs-Trace-Spans ein
- `includeRateLimits`: Schließt Informationen zum Ratenlimit ein (Sync/Async-Limits und verbleibende)
- `includeUsageData`: Schließt Abrechnungszeitraum-Nutzung und -Limits ein
### Alarmregeln
Anstatt Benachrichtigungen für jede Ausführung zu erhalten, konfigurieren Sie Alarmregeln, um nur bei erkannten Problemen benachrichtigt zu werden:
**Aufeinanderfolgende Fehler**
- Alarm nach X aufeinanderfolgenden fehlgeschlagenen Ausführungen (z.B. 3 Fehler in Folge)
- Wird zurückgesetzt, wenn eine Ausführung erfolgreich ist
**Fehlerrate**
- Alarm, wenn die Fehlerrate X% in den letzten Y Stunden überschreitet
- Erfordert mindestens 5 Ausführungen im Zeitfenster
- Wird erst nach Ablauf des vollständigen Zeitfensters ausgelöst
**Latenz-Schwellenwert**
- Alarm, wenn eine Ausführung länger als X Sekunden dauert
- Nützlich zum Erkennen langsamer oder hängender Workflows
**Latenz-Spitze**
- Alarm, wenn die Ausführung X% langsamer als der Durchschnitt ist
- Vergleicht mit der durchschnittlichen Dauer über das konfigurierte Zeitfenster
- Erfordert mindestens 5 Ausführungen, um eine Baseline zu etablieren
**Kostenschwelle**
- Alarmierung, wenn eine einzelne Ausführung mehr als $X kostet
- Nützlich, um teure LLM-Aufrufe zu erkennen
**Keine Aktivität**
- Alarmierung, wenn innerhalb von X Stunden keine Ausführungen stattfinden
- Nützlich zur Überwachung geplanter Workflows, die regelmäßig ausgeführt werden sollten
**Fehlerzählung**
- Alarmierung, wenn die Fehleranzahl X innerhalb eines Zeitfensters überschreitet
- Erfasst die Gesamtfehler, nicht aufeinanderfolgende
Alle Alarmtypen beinhalten eine Abklingzeit von 1 Stunde, um Benachrichtigungsspam zu vermeiden.
### Webhook-Konfiguration
Für Webhooks stehen zusätzliche Optionen zur Verfügung:
- `url`: Ihre Webhook-Endpunkt-URL
- `secret`: Optionales Geheimnis für HMAC-Signaturverifizierung
### Payload-Struktur
Wenn eine Workflow-Ausführung abgeschlossen ist, sendet Sim die folgende Payload (über Webhook POST, E-Mail oder Slack):
```json
{
"id": "evt_123",
"type": "workflow.execution.completed",
"timestamp": 1735925767890,
"data": {
"workflowId": "wf_xyz789",
"executionId": "exec_def456",
"status": "success",
"level": "info",
"trigger": "api",
"startedAt": "2025-01-01T12:34:56.789Z",
"endedAt": "2025-01-01T12:34:57.123Z",
"totalDurationMs": 334,
"cost": {
"total": 0.00234,
"tokens": {
"prompt": 123,
"completion": 456,
"total": 579
},
"models": {
"gpt-4o": {
"input": 0.001,
"output": 0.00134,
"total": 0.00234,
"tokens": {
"prompt": 123,
"completion": 456,
"total": 579
}
}
}
},
"files": null,
"finalOutput": {...}, // Only if includeFinalOutput=true
"traceSpans": [...], // Only if includeTraceSpans=true
"rateLimits": {...}, // Only if includeRateLimits=true
"usage": {...} // Only if includeUsageData=true
},
"links": {
"log": "/v1/logs/log_abc123",
"execution": "/v1/logs/executions/exec_def456"
}
}
```
### Webhook-Header
Jede Webhook-Anfrage enthält diese Header (nur Webhook-Kanal):
- Jitter: Bis zu 10% zusätzliche Verzögerung, um Überlastung zu vermeiden
- Nur HTTP 5xx und 429 Antworten lösen Wiederholungen aus
- Zustellungen haben ein Timeout nach 30 Sekunden
<Callout type="info">
Webhook-Zustellungen werden asynchron verarbeitet und beeinträchtigen nicht die Leistung der Workflow-Ausführung.
</Callout>
## Best Practices
1. **Polling-Strategie**: Verwende bei der Abfrage von Logs eine cursor-basierte Paginierung mit `order=asc` und `startDate`, um neue Logs effizient abzurufen.
2. **Webhook-Sicherheit**: Konfiguriere immer ein Webhook-Secret und überprüfe Signaturen, um sicherzustellen, dass Anfragen von Sim stammen.
3. **Idempotenz**: Verwende den `Idempotency-Key`Header, um doppelte Webhook-Zustellungen zu erkennen und zu behandeln.
4. **Datenschutz**: Standardmäßig werden `finalOutput` und `traceSpans` aus den Antworten ausgeschlossen. Aktiviere diese nur, wenn du die Daten benötigst und die Datenschutzauswirkungen verstehst.
5. **Rate-Limiting**: Implementiere exponentielles Backoff, wenn du 429-Antworten erhältst. Überprüfe den `Retry-After`Header für die empfohlene Wartezeit.
## Rate-Limiting
Die API verwendet einen **Token-Bucket-Algorithmus** für die Ratenbegrenzung, der eine faire Nutzung ermöglicht und gleichzeitig Burst-Traffic zulässt:
| Plan | Anfragen/Minute | Burst-Kapazität |
|------|-----------------|----------------|
| Free | 10 | 20 |
| Pro | 30 | 60 |
| Team | 60 | 120 |
| Enterprise | 120 | 240 |
**Wie es funktioniert:**
- Tokens werden mit der Rate `requestsPerMinute` aufgefüllt
- Du kannst im Leerlauf bis zu `maxBurst` Tokens ansammeln
- Jede Anfrage verbraucht 1 Token
- Die Burst-Kapazität ermöglicht die Bewältigung von Verkehrsspitzen
Informationen zur Ratenbegrenzung sind in den Antwort-Headern enthalten:
- `X-RateLimit-Limit`: Anfragen pro Minute (Auffüllrate)
import { Callout } from 'fumadocs-ui/components/callout'
import { Card, Cards } from 'fumadocs-ui/components/card'
import { Image } from '@/components/ui/image'
Das Verständnis der Workflow-Ausführung in Sim ist entscheidend für die Erstellung effizienter und zuverlässiger Automatisierungen. Die Ausführungs-Engine verwaltet automatisch Abhängigkeiten, Parallelität und Datenfluss, um sicherzustellen, dass Ihre Workflows reibungslos und vorhersehbar ablaufen.
## Wie Workflows ausgeführt werden
Die Ausführungs-Engine von Sim verarbeitet Workflows intelligent, indem sie Abhängigkeiten analysiert und Blöcke in der effizientesten Reihenfolge ausführt.
### Parallele Ausführung als Standard
Mehrere Blöcke werden gleichzeitig ausgeführt, wenn sie nicht voneinander abhängig sind. Diese parallele Ausführung verbessert die Leistung erheblich, ohne dass eine manuelle Konfiguration erforderlich ist.
<Image
src="/static/execution/concurrency.png"
alt="Mehrere Blöcke, die nach dem Start-Block parallel ausgeführt werden"
width={800}
height={500}
/>
In diesem Beispiel werden sowohl der Kundensupport- als auch der Deep-Researcher-Agentenblock gleichzeitig nach dem Start-Block ausgeführt, was die Effizienz maximiert.
### Automatische Ausgabekombination
Wenn Blöcke mehrere Abhängigkeiten haben, wartet die Ausführungs-Engine automatisch auf den Abschluss aller Abhängigkeiten und stellt dann ihre kombinierten Ausgaben dem nächsten Block zur Verfügung. Keine manuelle Kombination erforderlich.
<Image
src="/static/execution/combination.png"
alt="Funktionsblock, der automatisch Ausgaben von mehreren vorherigen Blöcken empfängt"
width={800}
height={500}
/>
Der Funktionsblock erhält Ausgaben von beiden Agentenblöcken, sobald diese abgeschlossen sind, sodass Sie die kombinierten Ergebnisse verarbeiten können.
### Intelligentes Routing
Workflows können sich in mehrere Richtungen verzweigen, indem sie Routing-Blöcke verwenden. Die Ausführungs-Engine unterstützt sowohl deterministisches Routing (mit Bedingungsblöcken) als auch KI-gesteuertes Routing (mit Router-Blöcken).
<Image
src="/static/execution/routing.png"
alt="Workflow, der sowohl bedingte als auch router-basierte Verzweigungen zeigt"
width={800}
height={500}
/>
Dieser Workflow zeigt, wie die Ausführung unterschiedlichen Pfaden basierend auf Bedingungen oder KI-Entscheidungen folgen kann, wobei jeder Pfad unabhängig ausgeführt wird.
## Blocktypen
Sim bietet verschiedene Arten von Blöcken, die spezifische Zwecke in Ihren Workflows erfüllen:
<Cards>
<Card title="Auslöser" href="/triggers">
**Starter-Blöcke** initiieren Workflows und **Webhook-Blöcke** reagieren auf externe Ereignisse. Jeder Workflow benötigt einen Auslöser, um die Ausführung zu beginnen.
</Card>
<Card title="Verarbeitungsblöcke" href="/blocks">
**Agent-Blöcke** interagieren mit KI-Modellen, **Funktionsblöcke** führen benutzerdefinierten Code aus und **API-Blöcke** verbinden sich mit externen Diensten. Diese Blöcke transformieren und verarbeiten Ihre Daten.
</Card>
<Card title="Kontrollfluss" href="/blocks">
**Router-Blöcke** nutzen KI, um Pfade zu wählen, **Bedingungsblöcke** verzweigen basierend auf Logik und **Schleifen-/Parallelblöcke** handhaben Iterationen und Nebenläufigkeit.
</Card>
<Card title="Ausgabe & Antwort" href="/blocks">
**Antwortblöcke** formatieren endgültige Ausgaben für APIs und Chat-Schnittstellen und liefern strukturierte Ergebnisse aus Ihren Workflows.
</Card>
</Cards>
Alle Blöcke werden automatisch basierend auf ihren Abhängigkeiten ausgeführt - Sie müssen die Ausführungsreihenfolge oder das Timing nicht manuell verwalten.
## Ausführungsüberwachung
Wenn Workflows ausgeführt werden, bietet Sim Echtzeit-Einblick in den Ausführungsprozess:
- **Live-Block-Status**: Sehen Sie, welche Blöcke gerade ausgeführt werden, abgeschlossen sind oder fehlgeschlagen sind
- **Ausführungsprotokolle**: Detaillierte Protokolle erscheinen in Echtzeit und zeigen Eingaben, Ausgaben und eventuelle Fehler
- **Leistungskennzahlen**: Verfolgen Sie die Ausführungszeit und Kosten für jeden Block
- **Pfadvisualisierung**: Verstehen Sie, welche Ausführungspfade durch Ihren Workflow genommen wurden
<Callout type="info">
Alle Ausführungsdetails werden erfasst und sind auch nach Abschluss der Workflows zur Überprüfung verfügbar, was bei der Fehlerbehebung und Optimierung hilft.
</Callout>
## Wichtige Ausführungsprinzipien
Das Verständnis dieser Grundprinzipien wird Ihnen helfen, bessere Workflows zu erstellen:
1. **Abhängigkeitsbasierte Ausführung**: Blöcke werden nur ausgeführt, wenn alle ihre Abhängigkeiten abgeschlossen sind
2. **Automatische Parallelisierung**: Unabhängige Blöcke laufen ohne Konfiguration gleichzeitig
3. **Intelligenter Datenfluss**: Ausgaben fließen automatisch zu verbundenen Blöcken
4. **Fehlerbehandlung**: Fehlgeschlagene Blöcke stoppen ihren Ausführungspfad, beeinflussen aber keine unabhängigen Pfade
5. **Zustandspersistenz**: Alle Blockausgaben und Ausführungsdetails werden für die Fehlerbehebung gespeichert
## Nächste Schritte
Nachdem Sie die Grundlagen der Ausführung verstanden haben, erkunden Sie:
- **[Blocktypen](/blocks)** - Erfahren Sie mehr über spezifische Block-Funktionen
- **[Protokollierung](/execution/logging)** - Überwachen Sie Workflow-Ausführungen und beheben Sie Probleme
- **[Kostenberechnung](/execution/costs)** - Verstehen und optimieren Sie Workflow-Kosten
- **[Trigger](/triggers)** - Richten Sie verschiedene Möglichkeiten ein, Ihre Workflows auszuführen
import { Callout } from 'fumadocs-ui/components/callout'
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
import { Image } from '@/components/ui/image'
Sim berechnet automatisch die Kosten für alle Workflow-Ausführungen und bietet transparente Preise basierend auf der Nutzung von KI-Modellen und Ausführungsgebühren. Das Verständnis dieser Kosten hilft Ihnen, Workflows zu optimieren und Ihr Budget effektiv zu verwalten.
## Wie Kosten berechnet werden
Jede Workflow-Ausführung umfasst zwei Kostenkomponenten:
**Basis-Ausführungsgebühr**: 0,001 $ pro Ausführung
**KI-Modellnutzung**: Variable Kosten basierend auf dem Token-Verbrauch
KI-Modellpreise werden pro Million Token berechnet. Die Berechnung teilt durch 1.000.000, um die tatsächlichen Kosten zu ermitteln. Workflows ohne KI-Blöcke verursachen nur die Basis-Ausführungsgebühr.
</Callout>
## Modellaufschlüsselung in Logs
Für Workflows mit KI-Blöcken können Sie detaillierte Kosteninformationen in den Logs einsehen:
<div className="flex justify-center">
<Image
src="/static/logs/logs-cost.png"
alt="Modellaufschlüsselung"
width={600}
height={400}
className="my-6"
/>
</div>
Die Modellaufschlüsselung zeigt:
- **Token-Nutzung**: Eingabe- und Ausgabe-Token-Anzahl für jedes Modell
- **Kostenaufschlüsselung**: Einzelkosten pro Modell und Operation
- **Modellverteilung**: Welche Modelle verwendet wurden und wie oft
- **Gesamtkosten**: Gesamtkosten für die gesamte Workflow-Ausführung
## Preisoptionen
<Tabs items={['Hosted Models', 'Bring Your Own API Key']}>
<Tab>
**Gehostete Modelle** - Sim stellt API-Schlüssel mit einem 2,5-fachen Preismultiplikator bereit:
**OpenAI**
| Modell | Basispreis (Eingabe/Ausgabe) | Gehosteter Preis (Eingabe/Ausgabe) |
Die angezeigten Preise entsprechen den Tarifen vom 10. September 2025. Überprüfen Sie die Dokumentation der Anbieter für aktuelle Preise.
</Callout>
## Strategien zur Kostenoptimierung
- **Modellauswahl**: Wählen Sie Modelle basierend auf der Komplexität der Aufgabe. Einfache Aufgaben können GPT-4.1-nano verwenden, während komplexes Denken möglicherweise o1 oder Claude Opus erfordert.
- **Prompt-Engineering**: Gut strukturierte, präzise Prompts reduzieren den Token-Verbrauch ohne Qualitätseinbußen.
- **Lokale Modelle**: Verwenden Sie Ollama oder VLLM für unkritische Aufgaben, um API-Kosten vollständig zu eliminieren.
- **Caching und Wiederverwendung**: Speichern Sie häufig verwendete Ergebnisse in Variablen oder Dateien, um wiederholte KI-Modellaufrufe zu vermeiden.
- **Batch-Verarbeitung**: Verarbeiten Sie mehrere Elemente in einer einzigen KI-Anfrage anstatt einzelne Aufrufe zu tätigen.
## Nutzungsüberwachung
Überwachen Sie Ihre Nutzung und Abrechnung unter Einstellungen → Abonnement:
- **Aktuelle Nutzung**: Echtzeit-Nutzung und -Kosten für den aktuellen Zeitraum
- **Nutzungslimits**: Plangrenzen mit visuellen Fortschrittsanzeigen
- **Abrechnungsdetails**: Prognostizierte Gebühren und Mindestverpflichtungen
- **Planverwaltung**: Upgrade-Optionen und Abrechnungsverlauf
### Programmatische Nutzungsverfolgung
Sie können Ihre aktuelle Nutzung und Limits programmatisch über die API abfragen:
**Endpunkt:**
```text
GET /api/users/me/usage-limits
```
**Authentifizierung:**
- Fügen Sie Ihren API-Schlüssel im `X-API-Key` Header hinzu
**Beispielanfrage:**
```bash
curl -X GET -H "X-API-Key: YOUR_API_KEY" -H "Content-Type: application/json" https://sim.ai/api/users/me/usage-limits
```
**Beispielantwort:**
```json
{
"success": true,
"rateLimit": {
"sync": {
"isLimited": false,
"requestsPerMinute": 25,
"maxBurst": 50,
"remaining": 50,
"resetAt": "2025-09-08T22:51:55.999Z"
},
"async": {
"isLimited": false,
"requestsPerMinute": 200,
"maxBurst": 400,
"remaining": 400,
"resetAt": "2025-09-08T22:51:56.155Z"
},
"authType": "api"
},
"usage": {
"currentPeriodCost": 12.34,
"limit": 100,
"plan": "pro"
}
}
```
**Rate-Limit-Felder:**
- `requestsPerMinute`: Dauerhafte Rate-Begrenzung (Tokens werden mit dieser Rate aufgefüllt)
- `maxBurst`: Maximale Tokens, die Sie ansammeln können (Burst-Kapazität)
- `remaining`: Aktuell verfügbare Tokens (können bis zu `maxBurst` sein)
**Antwortfelder:**
- `currentPeriodCost` spiegelt die Nutzung in der aktuellen Abrechnungsperiode wider
- `limit` wird von individuellen Limits (Free/Pro) oder gepoolten Organisationslimits (Team/Enterprise) abgeleitet
- `plan` ist der aktive Plan mit der höchsten Priorität, der mit Ihrem Benutzer verknüpft ist
## Plan-Limits
Verschiedene Abonnementpläne haben unterschiedliche Nutzungslimits:
| Plan | Monatliches Nutzungslimit | Rate-Limits (pro Minute) |
import { Callout } from 'fumadocs-ui/components/callout'
import { Card, Cards } from 'fumadocs-ui/components/card'
import { Image } from '@/components/ui/image'
Die Ausführungs-Engine von Sim bringt Ihre Workflows zum Leben, indem sie Blöcke in der richtigen Reihenfolge verarbeitet, den Datenfluss verwaltet und Fehler elegant behandelt, sodass Sie genau verstehen können, wie Workflows in Sim ausgeführt werden.
<Callout type="info">
Jede Workflow-Ausführung folgt einem deterministischen Pfad, der auf Ihren Blockverbindungen und Ihrer Logik basiert, um vorhersehbare und zuverlässige Ergebnisse zu gewährleisten.
</Callout>
## Dokumentationsübersicht
<Cards>
<Card title="Grundlagen der Ausführung" href="/execution/basics">
Erfahren Sie mehr über den grundlegenden Ausführungsablauf, Blocktypen und wie Daten durch Ihren
Verstehen Sie, wie die Kosten für Workflow-Ausführungen berechnet und optimiert werden
</Card>
<Card title="Externe API" href="/execution/api">
Greifen Sie programmgesteuert über REST-API auf Ausführungsprotokolle zu und richten Sie Webhooks ein
</Card>
</Cards>
## Schlüsselkonzepte
### Topologische Ausführung
Blöcke werden in Abhängigkeitsreihenfolge ausgeführt, ähnlich wie eine Tabellenkalkulation Zellen neu berechnet. Die Ausführungs-Engine bestimmt automatisch, welche Blöcke basierend auf abgeschlossenen Abhängigkeiten ausgeführt werden können.
### Pfadverfolgung
Die Engine verfolgt aktiv Ausführungspfade durch Ihren Workflow. Router- und Bedingungsblöcke aktualisieren diese Pfade dynamisch und stellen sicher, dass nur relevante Blöcke ausgeführt werden.
### Schichtbasierte Verarbeitung
Anstatt Blöcke einzeln auszuführen, identifiziert die Engine Schichten von Blöcken, die parallel ausgeführt werden können, und optimiert so die Leistung für komplexe Workflows.
### Ausführungskontext
Jeder Workflow behält während der Ausführung einen umfangreichen Kontext bei, der Folgendes enthält:
- Block-Ausgaben und -Zustände
- Aktive Ausführungspfade
- Verfolgung von Schleifen- und Paralleliterationen
- Umgebungsvariablen
- Routing-Entscheidungen
## Deployment-Snapshots
Alle öffentlichen Einstiegspunkte – API, Chat, Zeitplan, Webhook und manuelle Ausführungen – führen den aktiven Deployment-Snapshot des Workflows aus. Veröffentliche ein neues Deployment, wann immer du die Arbeitsfläche änderst, damit jeder Auslöser die aktualisierte Version verwendet.
Das Deploy-Modal behält eine vollständige Versionshistorie bei – untersuche jeden Snapshot, vergleiche ihn mit deinem Entwurf und führe Upgrades oder Rollbacks mit einem Klick durch, wenn du eine frühere Version wiederherstellen musst.
## Programmatische Ausführung
Führe Workflows aus deinen Anwendungen heraus mit unseren offiziellen SDKs aus:
```bash
# TypeScript/JavaScript
npm install simstudio-ts-sdk
# Python
pip install simstudio-sdk
```
```typescript
// TypeScript Example
import { SimStudioClient } from 'simstudio-ts-sdk';
const client = new SimStudioClient({
apiKey: 'your-api-key'
});
const result = await client.executeWorkflow('workflow-id', {
input: { message: 'Hello' }
});
```
## Best Practices
### Design für Zuverlässigkeit
- Behandle Fehler elegant mit geeigneten Fallback-Pfaden
- Verwende Umgebungsvariablen für sensible Daten
- Füge Logging zu Funktionsblöcken für Debugging hinzu
### Optimiere Performance
- Minimiere externe API-Aufrufe wo möglich
- Nutze parallele Ausführung für unabhängige Operationen
- Cache Ergebnisse mit Memory-Blöcken wenn angemessen
### Überwache Ausführungen
- Überprüfe Logs regelmäßig, um Leistungsmuster zu verstehen
- Verfolge Kosten für KI-Modellnutzung
- Verwende Workflow-Snapshots zur Fehlerbehebung
## Was kommt als nächstes?
Beginne mit [Ausführungsgrundlagen](/execution/basics), um zu verstehen, wie Workflows laufen, und erkunde dann [Logging](/execution/logging), um deine Ausführungen zu überwachen, sowie [Kostenberechnung](/execution/costs), um deine Ausgaben zu optimieren.
import { Callout } from 'fumadocs-ui/components/callout'
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
import { Image } from '@/components/ui/image'
Sim bietet umfassende Protokollierung für alle Workflow-Ausführungen und gibt Ihnen vollständige Transparenz darüber, wie Ihre Workflows laufen, welche Daten durch sie fließen und wo möglicherweise Probleme auftreten.
## Protokollierungssystem
Sim bietet zwei komplementäre Protokollierungsschnittstellen, die verschiedenen Workflows und Anwendungsfällen entsprechen:
### Echtzeit-Konsole
Während der manuellen oder Chat-Workflow-Ausführung erscheinen Protokolle in Echtzeit im Konsolen-Panel auf der rechten Seite des Workflow-Editors:
<div className="flex justify-center">
<Image
src="/static/logs/console.png"
alt="Echtzeit-Konsolen-Panel"
width={400}
height={300}
className="my-6"
/>
</div>
Die Konsole zeigt:
- Fortschritt der Blockausführung mit Hervorhebung des aktiven Blocks
- Echtzeit-Ausgaben nach Abschluss der Blöcke
- Ausführungszeit für jeden Block
- Erfolgs-/Fehlerstatusanzeigen
### Protokollseite
Alle Workflow-Ausführungen – ob manuell ausgelöst, über API, Chat, Zeitplan oder Webhook – werden auf der dedizierten Protokollseite protokolliert:
<div className="flex justify-center">
<Image
src="/static/logs/logs.png"
alt="Protokollseite"
width={600}
height={400}
className="my-6"
/>
</div>
Die Protokollseite bietet:
- Umfassende Filterung nach Zeitraum, Status, Auslösertyp, Ordner und Workflow
- Suchfunktion über alle Protokolle
- Live-Modus für Echtzeit-Updates
- 7-tägige Protokollaufbewahrung (erweiterbar für längere Aufbewahrung)
## Protokolldetails-Seitenleiste
Durch Klicken auf einen Protokolleintrag öffnet sich eine detaillierte Seitenleistenansicht:
<div className="flex justify-center">
<Image
src="/static/logs/logs-sidebar.png"
alt="Protokoll-Seitenleiste mit Details"
width={600}
height={400}
className="my-6"
/>
</div>
### Block-Eingabe/Ausgabe
Sehen Sie den vollständigen Datenfluss für jeden Block mit Tabs zum Umschalten zwischen:
<Tabs items={['Output', 'Input']}>
<Tab>
**Output-Tab** zeigt das Ausführungsergebnis des Blocks:
- Strukturierte Daten mit JSON-Formatierung
- Markdown-Rendering für KI-generierte Inhalte
- Kopierschaltfläche für einfache Datenextraktion
</Tab>
<Tab>
**Input-Tab** zeigt, was an den Block übergeben wurde:
- Aufgelöste Variablenwerte
- Referenzierte Ausgaben anderer Blöcke
- Verwendete Umgebungsvariablen
- API-Schlüssel werden aus Sicherheitsgründen automatisch unkenntlich gemacht
</Tab>
</Tabs>
### Ausführungszeitlinie
Für Workflow-übergreifende Protokolle, sehen Sie detaillierte Ausführungsmetriken:
- Start- und Endzeitstempel
- Gesamtdauer des Workflows
- Ausführungszeiten einzelner Blöcke
- Identifikation von Leistungsengpässen
## Workflow-Snapshots
Für jede protokollierte Ausführung klicken Sie auf "Snapshot anzeigen", um den exakten Workflow-Zustand zum Ausführungszeitpunkt zu sehen:
<div className="flex justify-center">
<Image
src="/static/logs/logs-frozen-canvas.png"
alt="Workflow-Snapshot"
width={600}
height={400}
className="my-6"
/>
</div>
Der Snapshot bietet:
- Eingefrorene Arbeitsfläche, die die Workflow-Struktur zeigt
- Block-Zustände und Verbindungen, wie sie während der Ausführung waren
- Klicken Sie auf einen beliebigen Block, um dessen Ein- und Ausgaben zu sehen
- Nützlich zum Debuggen von Workflows, die seitdem geändert wurden
<Callout type="info">
Workflow-Snapshots sind nur für Ausführungen verfügbar, die nach der Einführung des erweiterten Protokollierungssystems durchgeführt wurden. Ältere migrierte Protokolle zeigen die Meldung "Protokollierter Zustand nicht gefunden".
</Callout>
## Protokollaufbewahrung
- **Kostenloser Plan**: 7 Tage Protokollaufbewahrung
import { Callout } from 'fumadocs-ui/components/callout'
import { Card, Cards } from 'fumadocs-ui/components/card'
import { File, Files, Folder } from 'fumadocs-ui/components/files'
import { Step, Steps } from 'fumadocs-ui/components/steps'
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
import {
AgentIcon,
ApiIcon,
ChartBarIcon,
CodeIcon,
ConditionalIcon,
ConnectIcon,
ExaAIIcon,
FirecrawlIcon,
GmailIcon,
NotionIcon,
PerplexityIcon,
SlackIcon,
} from '@/components/icons'
import { Video } from '@/components/ui/video'
import { Image } from '@/components/ui/image'
Erstelle deinen ersten KI-Workflow in 10 Minuten. In diesem Tutorial wirst du einen Personenrecherche-Agenten erstellen, der fortschrittliche LLM-gestützte Suchwerkzeuge nutzt, um Informationen über Personen zu extrahieren und zu strukturieren.
<Callout type="info">
Dieses Tutorial behandelt die wesentlichen Konzepte zum Erstellen von Workflows in Sim. Geschätzte Bearbeitungszeit: 10 Minuten.
</Callout>
## Was du erstellen wirst
Einen Personenrecherche-Agenten, der:
1. Benutzereingaben über eine Chat-Schnittstelle akzeptiert
2. Das Web mit KI-gestützten Tools durchsucht (Exa und Linkup)
3. Informationen über Personen extrahiert und strukturiert
4. Formatierte JSON-Daten mit Standort, Beruf und Ausbildung zurückgibt
<Image
src="/static/getting-started/started-1.png"
alt="Beispiel für erste Schritte"
width={800}
height={500}
/>
## Schritt-für-Schritt-Anleitung
<Steps>
<Step title="Workflow erstellen und einen KI-Agenten hinzufügen">
Klicke im Dashboard auf **Neuer Workflow** und benenne ihn "Getting Started".
Jeder neue Workflow enthält standardmäßig einen **Start-Block** – dies ist der Eingangspunkt, der Benutzereingaben empfängt. Da wir diesen Workflow über Chat auslösen werden, ist keine Konfiguration für den Start-Block erforderlich.
Ziehe einen **Agenten-Block** aus dem linken Bereich auf die Arbeitsfläche und konfiguriere ihn:
- **Modell**: Wähle "OpenAI GPT-4o"
- **System-Prompt**: "Du bist ein Personenrecherche-Agent. Wenn dir ein Name einer Person gegeben wird, nutze deine verfügbaren Suchwerkzeuge, um umfassende Informationen über sie zu finden, einschließlich ihres Standorts, Berufs, Bildungshintergrunds und anderer relevanter Details."
- **Benutzer-Prompt**: Ziehe die Verbindung vom Ausgabefeld des Start-Blocks in dieses Feld, um `<start.input>` mit dem Benutzer-Prompt zu verbinden
Kehre zum **Chat-Panel** zurück, um das strukturierte Antwortformat zu testen.
Mit dem konfigurierten Antwortformat sind jetzt neue Ausgabeoptionen verfügbar:
- Klicke auf das Dropdown-Menü und wähle die Option für strukturierte Ausgabe (das Schema, das du gerade erstellt hast)
- Gib eine Testnachricht ein: "Sarah ist eine Marketing-Managerin aus New York mit einem MBA von der Harvard Business School."
- Klicke auf **Senden**, um den Workflow auszuführen
Der Agent wird nun strukturierte JSON-Ausgabe zurückgeben, wobei die Informationen der Person in die Felder Standort, Beruf und Ausbildung organisiert sind.
import { Card, Cards } from 'fumadocs-ui/components/card'
# Sim Dokumentation
Willkommen bei Sim, einem visuellen Workflow-Builder für KI-Anwendungen. Erstellen Sie leistungsstarke KI-Agenten, Automatisierungs-Workflows und Datenverarbeitungs-Pipelines, indem Sie Blöcke auf einer Leinwand verbinden.
Externe Dienste mit dem Model Context Protocol verbinden
</Card>
<Card title="SDKs" href="/sdks">
Sim in Ihre Anwendungen integrieren
</Card>
</Cards>
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.